Here's the recent changes to AST Unparser.
- Add full support for Python 3.8
- Add support for the Constant node in Python 3.8
- Add tests to the sdist
- Fix the roundtripping of very complex f-strings.
- Python 3.7 compatibility
- Python 3.6 compatibility
- bugfix: correct argparser option type
- Support for the
async
keyword - Support for unparsing "Interactive" and "Expression" nodes
- Python 3.5 compatibility
- Python 2.6 through 3.4 compatibility
- A new function
dump
is added to return a pretty-printed version of the AST. It's also available when runningpython -m astunparse
as the--dump
argument.
unparse
will return the source code for an AST. It is pretty feature-complete, and round-trips the stdlib, and is compatible with Python 2.7 and Python 3.4.Running
python -m astunparse
will print the round-tripped source for any python files given as argument.