[Python-ideas] AST Pretty Printer
paultag at debian.org
Fri Sep 13 04:44:14 CEST 2013
On Thu, Sep 12, 2013 at 06:31:08PM -0500, Ryan wrote:
> I always encounter one problem when dealing with Python ASTs: When I print
> it, it looks like Lisp(aka Lots of Irritated Superfluous Parenthesis). In
> short: it's a mess.
Bwahah; well, to each their own.
As some might remember from PyCon this year, I actually wrote a lisp
front-end (OK, not *really* lisp) to Python AST. Works pretty well (even
smoothed out the 2.x and 3.x differences, so most code is valid between
Yes, it's hilarious. No, parens aren't ugly :)
> My idea is an AST pretty printer built on ast.NodeVisitor. If anyone finds
> this interesting, I can probably have a prototype of the class between
> later today and sometime tomorrow.
I'd enjoy such a thing!
.''`. Paul Tagliamonte <paultag at debian.org>
: :' : Proud Debian Developer
`. `'` 4096R / 8F04 9AD8 2C92 066C 7352 D28A 7B58 5B30 807C 2A87
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the Python-ideas