[issue11105] Compiling evil ast crashes interpreter

Georg Brandl report at bugs.python.org
Thu Feb 3 21:14:55 CET 2011


Georg Brandl <georg at python.org> added the comment:

Alex: If the node attributes were not mutable, it would be extremely awkward, not to say inefficient, to mutate an already existing AST as returned by ast.parse().

The AST objects in the _ast module aren't what Python works with internally, anyway. When calling ast.parse(), the AST is converted to Python objects (these are defined in Python-ast.c), and compile()ing such an object converts them back to the internal tree representation.  This conversion is where recursions would need to be handled.

----------
nosy: +georg.brandl

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


More information about the Python-bugs-list mailing list