Python indentation

Istvan Albert ialbert at
Wed Jul 7 22:03:30 CEST 2004

Sateesh wrote:

> Why can't the indentation not so strict so as to give better freedom to the
> user?
> Is there any plausible reason behind this?

What will bother you even more is that the "official"
recommendation is that you should be using spaces to
indent not tabs... the reason appears to be that tabs
might not copy properly from some terminal windows...

I like python very much, but every time I see a space indented
module the first thing I do is to replace the spaces with

I noticed that beginners like to indent more while experts
indent less. Once your eye is trained 2 levels might
be enough. OTOH it depends on the project, with many nested loops
you're better off with wider display. IMHO a display of
3 spaces is the best....

But if you stick with the "official" recommendation
then you have to press four spaces or four deletes on the first level,
eight on the second etc... to align stuff...

Yeah, yeah I know that this or that editor has a shortcut enabled via
CTRL+ALT+INSERT+SPACE+double-click+W and that will do the job in one
keystroke, but sometimes you need to work with unfamiliar editors
and odd circumstances and then the whole spaces vs tabs argument
becomes extremely relevant and the wide adoption of "spaces"
makes it a drag.

one more thing to consider...


More information about the Python-list mailing list