Tabs and spaces (style)

Ken Seehof kens at sightreader.com
Tue May 1 16:30:03 EDT 2001


----- Original Message ----- 
Cantanker wrote:

> What is the consensus about mixing tabs and spaces in a Python script?
> 
> Don't people find it plain annoying to come across a bunch of scripts
> where the author has obviously used a tabsize of 8 characters, and
> alternated expanded tabs (4-spaces) and real tab characters (not wanting
> to name names here *cough*Mailman*cough*). It makes for a real PITA when
> you set your editor to display tab characters with a width of 2, or 4
> spaces, and the code doesn't line up properly. 
> 
> It imposes one author's choice of tabsize onto everyone else.
> 
> Thoughts?
> 
> 
> -- 
> Cantanker /

Steve Holden wrote:
> "Nick Perkins" <nperkins7 at home.com> wrote in message
> news:oGDH6.38803$HF.9074854 at news4.rdc1.on.home.com...
> > Absolutely!
> > ..that drives me nuts!
> > Why would anyone not use tabs exclusively?
> >
> because
>         tabs
>                 take up a lot
>                         of horizontal space
>                                 and your
>                                         code ends
>                                                 up dropping
>                                                         off the end
>                                                                 of the
> 
> page...
> 
> Four spaces is fine. Mixing tabs is *not* good. Use redent.py
> 
> regards
>  Steve

Why would anyone not use spaces exclusively?

BTW,  I read a posting by Guido quite a while ago that
actually recommended mixing tabs and spaces!  Rather
ugly advice; quite out of character coming from our fearless
leader. :-)

Tabs should be a syntax error.

I hereby declare the following concensus:
    Indent 4 spaces.  No tabs.

All good code editors have built in tab converters.

- Ken






More information about the Python-list mailing list