berkerpeksag / astor

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

Retire `astor`, as `ast.unparse` exists, and migrate it into API-compatible shims of `ast` for older versions of python #204

Open KOLANICH opened 2 years ago

SamuelMarks commented 2 years ago

Yep I've been doing that for ages: https://github.com/offscale/cdd-python/blob/f64f886/cdd/source_transformer.py#L13-L27

Kodiologist commented 2 years ago

Hy also does this, since https://github.com/hylang/hy/pull/1999. astor might as well do it internally.

leycec commented 1 year ago

Necrobump. The astor.code_to_ast() function decompiling arbitrary code objects into corresponding ASTs still appears to have no equivalent in any other library – including the standard ast module. Is that correct? If so, astor should absolutely not retire but instead mono-focus on this one thing astor still does that nobody else does.

In fact, that's exactly how I discovered astor: via this StackOverflow question, whose first comment namedrops astor as the only available solution. Long live astor! :fist_raised: