berkerpeksag / astor

Python AST read/write
https://pypi.org/project/astor/
BSD 3-Clause "New" or "Revised" License
810 stars 102 forks source link

Several codegen bugs found #27

Closed pmaupin closed 9 years ago

pmaupin commented 9 years ago

I will be committing a branch with tests to deal with these:

1) Keyword-only should arguments come before '**'

2) 'from .. import' with no trailing module name did not work.

3) try/finally needs to come after else

4) Sometimes integers have attributes, e.g. (0).real We need the parentheses in this case, and did not have them.

5) When yield is an expression rather than a statement, it can be a syntax error if it is not enclosed in parentheses.