Why not enforce four space indentations in version 3.x?

Tim Chase python.list at tim.thechases.com
Thu Jul 16 10:18:47 EDT 2009


> I realize that a small portion of the community likes the tabs.
> They're sold on the tabs. They like the tabs. But tabs are an archaic
> holdover from an era when typewriters had physical tabstops on them.

However, they are a single logical level of indentation -- I come 
down fairly solidly on the "tabs" side of the "tabs vs. spaces" 
argument.  I can set my editor (vim in this case) to show tabs as 
as many spaces as I want.  I usually have this set to 4, but 
sometimes 1 or 2.  In Vim, using tabs I can just switch up my 
tab-stop setting (":set ts=2") and the presentation of my code 
reindents the way I expect.  If I wanted to switch from 
4-real-spaces to 2-real-spaces, I'd have to concoct a perlish 
regexp to handle the munging.

The same "separation of content and presentation" that is all the 
rage with N-tier programmers and web developers, my content is 
"logical levels of indentation indicated by a tab character in 
the source-code" and my presentation is "N spaces as presented by 
my editor".

Yes, the dictatorial "a tab always equals 8 spaces" is a 
vestigial holdover for which I hold no love.

I'll code on other people's projects with spaces if that's the 
project convention (as Vim lets me switch around fairly easily). 
  But as for my own code, it's tabs all the way.

-tkc






More information about the Python-list mailing list