-
Notifications
You must be signed in to change notification settings - Fork 4
It does not preserve per-argument type comments #2
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
Comments
Thanks for reporting, will look into that! |
(Also see that the docstring does not use |
I've verified that the per-argument type comments are indeed not working. I'll fix it. However, the docstring issue is out of scope for this unparser. There was a similar issue upstream (astunparse): simonpercivall/astunparse#13 however it was closed. I'm working towards implementing proper docstring unparsing, (as well as arbitrary comment parsing and unparsing) in a different module: https://github.com/mbdevpl/horast however it's not nearly ready yet. |
And, there seems to be an issue in |
Thanks for looking into this. |
(BTW, I used your project here: nvbn/py-backwards#44) |
Not minding the issue with typed_ast (hopefully it'll get resolved someday) I added the per-argument type comment unparsing and released https://pypi.python.org/pypi/typed-astunparse/2.0.2 |
Oho! Thanks! |
Oh, and BTW, I just found out that docstrings might be properly stored in AST starting from Python 3.7 - if they will be, then I guess astunparse and typed_astunparse will handle them properly. https://bugs.python.org/issue29463 |
This strips per-argument type comments (example taken from PEP 484):
Output is:
The text was updated successfully, but these errors were encountered: