-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
typed-ast: fix get_docstring, allow buffer #9019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
def copy_location(new_node: AST, old_node: AST) -> AST: ... | ||
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: ... |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
No description provided.