python with braces pre-processor

Jean-Paul Calderone exarkun at divmod.com
Mon Oct 22 08:17:23 EDT 2007


On Mon, 22 Oct 2007 09:44:27 +0000 (UTC), Paul Brauner <paul.brauner at loria.fr> wrote:
> [snip]
> I thought that it must exists because everyone generating python code will
>encounter more or less the same problem, but I didn't find any 'official'
>thing on the subject.

I expect many projects which emit Python code actually emit Python code.
Getting the indentation right isn't much of a chore at all.  If you need
some help to get it right, maybe this will get you going in the right
direction:

  http://twistedmatrix.com/trac/browser/sandbox/exarkun/ast/ast_pp.py

It's just some throw-away code, but it at least manages to indent code
properly.

Jean-Paul



More information about the Python-list mailing list