-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Retire astor
, as ast.unparse
exists, and migrate it into API-compatible shims of ast
for older versions of python
#204
Comments
Yep I've been doing that for ages: https://github.com/offscale/cdd-python/blob/f64f886/cdd/source_transformer.py#L13-L27 |
Hy also does this, since hylang/hy#1999. astor might as well do it internally. |
Necrobump. The In fact, that's exactly how I discovered |
Annoyingly,
ikamensh/flynt#195 is currently struggling with this and would benefit from |
That seems like an unforced error. If I recall correctly, Python's |
Another difference in behavior between >>> import ast
>>> import astor
>>> node = ast.JoinedStr(
... values=[ast.FormattedValue(value=ast.IfExp(test=ast.Name(id='c'), body=ast.Name(id='a'), orelse=ast.Name(id='b')), conversion=-1)]
... )
>>> print(ast.unparse(node))
f'{(a if c else b)}'
>>> print(astor.to_source(node))
f"""{a if c else b}""" This is being discussed in ikamensh/flynt#205, preventing migrating from |
No description provided.
The text was updated successfully, but these errors were encountered: