Non-Indented python

Justin Sheehy justin at iago.org
Fri Nov 30 12:29:15 EST 2001


Nicholas FitzRoy-Dale <wzdd at lardcave.net> writes:

> This isn't directed at Marcin, but I don't understand why people keep
> going on about this, because it's not accomplishing anything.

Indeed.  It's been a dead issue for years.

That doesn't stop someone new from bringing it up every few months.

> Nobody has presented a convincing argument for tabs-only, spaces-only,
> or 8-char tabs only, because there isn't one.

Right on the first two, wrong on the third.

>From the Python Language Reference, in the section describing how the
language treats indentation:

  First, tabs are replaced (from left to right) by one to eight spaces
  such that the total number of characters up to and including the
  replacement is a multiple of eight 

The Python parser makes the only argument necessary for 8-char tabs
only, as anything else will provide a view inconsistent with the
behavior of the language.  

Yes, you can make it work with another view if you absolutely never
touch code with spaces used, but it's still asking for trouble to
differ from what the language does in this way.  You may use whatever
view of hard tab characters you wish, but anything other than 8 spaces
will provide you with a view inconsistent with the language's
behavior.

Personally, I consider this and also the convention of the Python
Standard Library to be sufficient argument that the right style for me
to use is spaces-only, four-space indent levels.  Use tabs in your own
code all you like, though.  I won't argue with you.  I'll just
untabify it if I ever have to work with it.

-Justin

 







More information about the Python-list mailing list