[Python-ideas] An Alternate Suite Delineation Syntax For Python? (was Re: [Python-Dev] [PATCH] Adding braces to __future__)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Dec 12 06:27:22 CET 2011


Mike Meyer wrote:

> The reason you generate python instead of pyc is that backward
> compatibility of python source is a priority for python development,
> so with a little care your generated code will work across multiple
> versions of python.

Another approach would be to generate an AST (either an actual
Python AST or one of your own devising) and then traverse it
to generate indented source code. This is another way of
isolating knowledge of the indentation level to one part of
the code.

-- 
Greg



More information about the Python-ideas mailing list