Tabs and spaces (style)

Ken Seehof kens at
Tue May 1 22:30:03 CEST 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> wrote in message
> news:oGDH6.38803$HF.9074854 at
> > 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
> 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