Including the unparse module in the standard library

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

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@gmail.com> wrote:

On Thu, 12 Jul 2018 at 11:21 Andre Roberge <andre.roberge@gmail.com> wrote:
Maintained doesn't mean it's check on very often, nor designed well or updated. ;)
would it be possible to include the unparse module in the standard library?
Since it isn't necessary for Python to function, I would say we probably don''t want to pull it up. Then the maintenance burden grows much more.

On Mon, Jul 16, 2018 at 12:24 PM, Brett Cannon <brett@python.org> wrote:
Since it isn't necessary for Python to function, I would say we probably don''t want to pull it up. Then the maintenance burden grows much more.
might make sense to put it on pypi though, if someone want to take responsibility for it. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

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@gmail.com> wrote:

On Thu, 12 Jul 2018 at 11:21 Andre Roberge <andre.roberge@gmail.com> wrote:
Maintained doesn't mean it's check on very often, nor designed well or updated. ;)
would it be possible to include the unparse module in the standard library?
Since it isn't necessary for Python to function, I would say we probably don''t want to pull it up. Then the maintenance burden grows much more.

On Mon, Jul 16, 2018 at 12:24 PM, Brett Cannon <brett@python.org> wrote:
Since it isn't necessary for Python to function, I would say we probably don''t want to pull it up. Then the maintenance burden grows much more.
might make sense to put it on pypi though, if someone want to take responsibility for it. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
participants (4)
-
Andre Roberge
-
Brett Cannon
-
Chris Barker
-
Ryan Gonzalez