[issue11549] Rewrite peephole to work on AST
Nick Coghlan
report at bugs.python.org
Mon Mar 28 05:52:35 CEST 2011
Nick Coghlan <ncoghlan at gmail.com> added the comment:
OK, I missed the fact that the new optimisation pass isn't run under PyCF_ONLY_AST.
However, as Eugene picked up, my concern is actually with the collapsing of Str/Num/Bytes/Ellipsis into the new Lit node, and the changes to the way None/True/False are handled. They're all changes that *make sense*, but would also likely cause a variety of AST manipulations to break. We definitely don't care when bytecode hacks break, but providing the ast module means that AST manipulation is officially supported.
However, the reason I bring up new constructs, is the fact that new constructs may break AST manipulation passes, even if the old structures are left intact - the AST visitor may miss (or misinterpret) things because it doesn't understand the meaning of the new nodes.
We may need to take this one back to python-dev (and get input from the other implementations as well). It's a fairly fundamental question when it comes to the structure of any changes.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11549>
_______________________________________
More information about the Python-bugs-list
mailing list