NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1088 most downloaded on PyPI
Read/rewrite/write Python ASTs
Last release 7 years ago
no release in 18 months
Release timing varies
gaps range from 1 weeks to 2.5 years
Nearly every release is documented
notes for 14 of 14 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
14 releases · first in 2012
Create sdist before making a test release too
Create sdist before making a test release too
Fixed precedence issue for f-string expressions that caused redundant parenthesis around expression. (Reported by Ilya Kamenshchikov in Issue 153 and fixed by Batuhan Taskaya in PR 155.)
Fixed astor.to_source incorrectly checking whether source_generator_class is a subclass of astor.code_gen.SourceGenerator. (Reported by Yu-Chia "Hank" Liu in Issue 158 and fixed by Will Crichton in PR 164.)
Fixed TypeError when AST nodes with unicode strings are passed to astor.to_source. (Reported and fixed by Dominik Moritz in PR 154.)
One column per quarter.
Support ast.Constant nodes being emitted by Python 3.8 (and initially created in Python 3.6). (Reported and fixed by Chris Rink in Issue 120_ and PR 1
Support ast.Constant nodes being emitted by Python 3.8 (and initially created in Python 3.6). (Reported and fixed by Chris Rink in Issue 120 and PR 121.)
Support Python 3.8's assignment expressions. (Reported and fixed by Kodi Arfer in Issue 126 and PR 134.)
Support Python 3.8's f-string debugging syntax. (Reported and fixed by Batuhan Taskaya in Issue 138 and PR 139.)
astor.to_source now has a source_generator_class parameter to customize source code generation. (Reported and fixed by matham in Issue 113 and PR 114.)
The ~SourceGenerator class can now be imported from the astor package directly. Previously, the astor.code_gen submodule was needed to be imported.
Support Python 3.8's positional only arguments. See 570 for more details. (Reported and fixed by Batuhan Taskaya in Issue 142 and PR 143.)
Fix string parsing when there is a newline inside an f-string. (Reported by Adam Cécile in Issue 119 and fixed by Felix Yan in PR 123.)
Fixed code generation with escaped braces in f-strings. (Reported by Felix Yan in Issue 124 and fixed by Kodi Arfer in PR 125.)
Fixed code generation with attributes of integer literals, and with u-prefixed string literals. (Fixed by Kodi Arfer in PR 133.)
Fixes #116
Fixes #116
Fixed installation error by adding the setuputils.py helper to the sdist. (Reported by Adam and fixed by Berker Peksag in Issue 116.)
Added initial support for Python 3.7.0.
Added initial support for Python 3.7.0.
Note that if you have a subclass of astor.code_gen.SourceGenerator, you may need to rename the keyword argument async of the following methods to is_async:
visit_FunctionDef(..., is_async=False)
visit_For(..., is_async=False)
visit_With(..., is_async=False)
(Reported and fixed by Berker Peksag in Issue 86.)
Dropped support for Python 2.6 and Python 3.3.
Fixed a bug where newlines would be inserted to a wrong place during printing f-strings with trailing newlines. (Reported by Felix Yan and contributed by Radomír Bosák in Issue 89.)
Improved code generation to support ast.Num nodes containing infinities or NaNs. (Reported and fixed by Kodi Arfer in Issue 85 and Issue 100.)
Improved code generation to support empty sets. (Reported and fixed by Kodi Arfer in Issue 108.)
Fix 'make clean' command
Fix 'make clean' command
Restore backwards compatibility that was broken after 0.6.1. You can now continue to use the following pattern:
import astor
class SpamCodeGenerator(astor.codegen.SourceGenerator):
...
(Reported by Dan Moldovan and fixed by Berker Peksag in Issue 87.)
Fix 'make release' command
Fix 'make release' command
Added astor.parse_file() as an alias to astor.code_to_ast.parsefile(). (Contributed by Berker Peksag.)
Fix compatibility layer for the astor.codegen submodule. Importing astor.codegen now succeeds and raises a DeprecationWarning instead of ImportError. (Contributed by Berker Peksag.)
Code cleanup, including renaming for 8 and deprecation of old names. (Contributed by Leonard Truong in Issue 36_.)
New astor.rtrip command-line tool to test round-tripping of Python source to AST and back to source. (Contributed by Patrick Maupin.)
New pretty printer outputs much better looking code:
Remove parentheses where not necessary
Use triple-quoted strings where it makes sense
Add placeholder for function to do nice line wrapping on output
(Contributed by Patrick Maupin.)
Additional Python 3.5 support:
Additional unpacking generalizations (448)
Async and await (492)
(Contributed by Zack M. Davis.)
Added Python 3.6 feature support:
f-strings (498)
async comprehensions (530)
variable annotations (526)
(Contributed by Ryan Gonzalez.)
Code cleanup, including renaming for 8 and deprecation of old names. (Contributed by Leonard Truong in Issue 36.)
Don't put trailing comma-spaces in dictionaries. astor will now create {'three': 3} instead of {'three': 3, }. (Contributed by Zack M. Davis.)
Fixed several bugs in code generation:
Keyword-only arguments should come before **
from .. import <member> with no trailing module name did not work
Support from .. import foo as bar syntax
Support with foo: ..., with foo as bar: ... and with foo, bar as baz: ... syntax
Support 1eNNNN syntax
Support return (yield foo) syntax
Support unary operations such as -(1) + ~(2) + +(3)
Support if (yield): pass
Support if (yield from foo): pass
try...finally block needs to come after the try...else clause
Wrap integers with parentheses where applicable (e.g. (0).real should generated)
When the yield keyword is an expression rather than a statement, it can be a syntax error if it is not enclosed in parentheses
Remove extraneous parentheses around yield from
(Contributed by Patrick Maupin in Issue 27.)
Remove 3.5 for now. It's not added to PyPI yet.
Remove 3.5 for now. It's not added to PyPI yet.
Added support for Python 3.5 infix matrix multiplication (465) (Contributed by Zack M. Davis.)
added missing arguments vistor from Armin's original repo
added missing arguments vistor from Armin's original repo
Add AUTHORS to MANIFEST.in.
Add AUTHORS to MANIFEST.in.
Added initial test suite and documentation
Added a visitor for NameConstant
Fixed a packaging bug on Python 3 -- see pull requests #1 and #2 for more information.
Added support for Python 3.3.
Added YieldFrom
Updated Try and With.
Fixed a packaging bug on Python 3 -- see pull requests #1 and #2 for more information.
Modified TreeWalk to add _name suffix for functions that work on attribute names
Modified TreeWalk to add _name suffix for functions that work on attribute names
Enhancements ~~~~~~~~~~~~ * Initial Python 3 support * Test of treewalk
Initial Python 3 support
Test of treewalk
Based on Armin Ronacher's codegen
Initial release
Based on Armin Ronacher's codegen
Several bug fixes to that and new tree walker
Your coding agent can read these notes before it upgrades. Set up the MCP server →