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

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


> Ok, so it sounds like ast is *not* limited to CPython? That makes it
> harder to justify changing it just so as to ease the compilation
> process in CPython (as opposed to add new language features).

I propose a different view: the AST *is* implementation specific,
although implementations are certainly encouraged to use a similar AST
if they provide an AST module at all.

Applications of it then explicitly need to be ported to each version
of each Python implementation that supports an AST module. If the
ASTs are similar, this porting will hopefully be easy.

The only alternative I can see is to freeze the AST structure, allowing
for extensions at best. I don't think any of the implementations are in
a state where such an approach is feasible.

Regards,
Martin



More information about the Python-Dev mailing list