[Python-Dev] Policy for making changes to the AST

"Martin v. Löwis" martin at v.loewis.de
Tue Apr 5 11:49:49 CEST 2011


> Add py.test as an application that uses the AST to support Jython,
> PyPy and CPython in a portable way.  I always assumed AST was created
> *because* bytecode was too CPython specific (but then I've never
> implemented a language).

Historically, that's incorrect. The AST structure was introduced to
simplify the implementation of (C)Python. Exposing it to Python modules
was done primarily because it's neat and was easy to do - not because
any specific use was expected, and certainly not as the primary
motivation for having an AST. It was clear (to me, at least) back then
that the AST will change over time (hence the module was originally
called _ast).

Regards,
Martin


More information about the Python-Dev mailing list