Colons, indentation and reformatting. (2)

Hendrik van Rooyen mail at microcorp.co.za
Wed Jan 10 00:31:36 EST 2007


 "Jorgen Grahn" <grahn+nntp at snipabacken.dyndns.org>wrote:

> On 8 Jan 2007 23:57:29 -0800, Paddy <paddy3118 at netscape.net> wrote:
> >
> > OK, whilst colons are not sufficient to re-format a completely
> > mis-indented file. I'm thinking that they are sufficient for
> > reformatting most pasted code blocks when refactoring say?
> 
> Let's put it this way: if the formatter can assume the original code is
> valid (i.e. has the intended indentation) then it can do all kinds of nifty
> things to it.

This is true - and I think it will only fail if the "entry" point in the pasted
code is "further to the right" than where it has to fit in to the original
code - i.e. if you "run out of space" to the left.  - but in that case
you really are hacking, and you are in urgent need of some slashing...

- Hendrik




More information about the Python-list mailing list