[issue24002] Add un-parse function to ast

Larry Hastings report at bugs.python.org
Sun Apr 19 07:57:06 CEST 2015


Larry Hastings added the comment:

Good idea, I'll go ahead and borrow Guido's time machine.

https://docs.python.org/3/library/ast.html#ast.NodeVisitor

However, NodeVisitor does not transform the ast tree back into text.  So in what way is this helpful?


Also, for what it's worth: both my use cases only need to handle expressions ("r-values" if you prefer).  I don't need to generate classes, functions, blocks, or even statements.  If we wanted to weaken the implementation to only handle expressions I'd be happy.  (In fact, I'd be happier this way, because it means the implementation would be much simpler!)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24002>
_______________________________________


More information about the Python-bugs-list mailing list