Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
def fix_missing_locations(node: AST) -> AST: ...
def get_docstring(node: AST, clean: bool = ...) -> bytes | None: ...
def get_docstring(node: AST, clean: bool = ...) -> str | bytes | None: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused about how this could be bytes, but then I remembered Python 2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ast27.get_docstring(ast27.parse("""def f(): 'hi'""").body[0]) does crash at runtime (but it works with clean=False)

@JelleZijlstra JelleZijlstra merged commit 7edad95 into python:master Oct 28, 2022
@hauntsaninja hauntsaninja deleted the typed-ast branch October 28, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants