Skip to content
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

Not rendering ** for PEP 448 Additional Unpacking Generalizations #83

Closed
gilch opened this issue Aug 3, 2017 · 1 comment
Closed

Not rendering ** for PEP 448 Additional Unpacking Generalizations #83

gilch opened this issue Aug 3, 2017 · 1 comment

Comments

@gilch
Copy link

gilch commented Aug 3, 2017

It looks like astor is not ready for some of the newer Python features.

Python 3.6.1

>>> import astor, ast
>>> astor.__version__
'0.5'
>>> compile("{1: 1, **{2: 2}}", "<str>", "exec", ast.PyCF_ONLY_AST)
<_ast.Module object at 0x00000180BB3F1F28>
>>> astor.codegen.to_source(_)
'{1: 1, None: {2: 2, }, }'

The stars are None: .

@berkerpeksag
Copy link
Owner

Thanks for the report. This is fixed in astor 0.6:

>>> import ast
>>> import astor
>>> compile("{1: 1, **{2: 2}}", "<str>", "exec", ast.PyCF_ONLY_AST)
<_ast.Module object at 0x7f0a3a080cf0>
>>> astor.to_source(_)
'{(1): 1, **{(2): 2}}\n'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants