Where to find python code beautifier ?

François Pinard pinard at iro.umontreal.ca
Sun May 19 21:18:04 EDT 2002


[François Pinard]

> > A human can do that, but it is less easy when Python code is
> > automatically generated.  This is the case in one of my projects,
> > and because of this, I do have a Python beautifier in the works.

[David LeBlanc]

> Did you take a look at pindent.py in the tools/scripts directory?
> Read the comment at the top of the file.

Yes, I'm aware of `pindent.py'.  The problem I got is not really with line
indentation (which is fairly easy to generate correctly), but rather with
breaking long lines into continuation at convenient places, and using
some reasonable indentation for continuation lines.  In this, choices
already made by the Emacs mode designers have been good sources of ideas.
Nice use of white space within a source line also requires some care.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list