[Python-ideas] Including the unparse module in the standard library

Ryan Gonzalez rymg19 at gmail.com
Thu Jul 12 14:54:50 EDT 2018


If you want to get source code from an AST, you'd probably be better off 
with a more fully-featured library like Astor: 
https://github.com/berkerpeksag/astor


On July 12, 2018 1:21:23 PM Andre Roberge <andre.roberge at gmail.com> wrote:

> In the cPython repository, there is an unparse module in the Tools section.
> https://github.com/python/cpython/blob/master/Tools/parser/unparse.py
>
> However, as it is not part of the standard library, it cannot be easily
> used; to do so, one needs to make a local copy in a place from where it can
> be imported.
>
> This module can be useful for people using the ast module to create and
> parse trees, modify them ... and who want to convert the result back into
> source code.  Since it is obviously maintained to be compatible with the
> current Python version, would it be possible to include the unparse module
> in the standard library?
>
> André Roberge
>
>
>
> ----------
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180712/dbc3598c/attachment.html>


More information about the Python-ideas mailing list