Question about indentation and bugs

Skip Montanaro skip at pobox.com
Sun Aug 26 00:12:36 CEST 2001


    Paul> On Fri, 24 Aug 2001 01:08:13 -0400, Peter Hansen
    Paul> <peter at engcorp.com> wrote: 
    >> Dave Swegen wrote:
    >> Maybe more importantly, if you don't actually use TABs, 
    >> or you consistently treat TABs as eight spaces, the problem 
    >> won't arise.

    Paul> Four spaces is now the "standard" according to PEP 8, replacing
    Paul> the old style guide.
    Paul> http://python.sourceforge.net/peps/pep-0008.html

    Paul> But then, the style guide says the same thing... How long ago was
    Paul> 8 considered the norm?

    Paul> Good thing they reduced it ... it doesn't take too many levels of
    Paul> indentation to get pretty cramped in a typical 80-character
    Paul> window!

You're talking about two different things.  The standard indentation is four
spaces, but if you treat a TAB character as eight spaces you'll be okay
(though with "python -t" you might get some indentation warnings).  It's
when you treat a TAB character as something other than 8 spaces that mixing
spaces and TABs becomes a problem.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list