DOS, UNIX and tabs

Erik Johnson ejatsomewhere.com
Wed Dec 27 20:04:56 EST 2006


"Ben Finney" <bignose+hates-spam at benfinney.id.au> wrote in message
news:mailman.2061.1167261027.32031.python-list at python.org...
> "Sebastian 'lunar' Wiesner" <basti.wiesner at gmx.net> writes:
>
> > Just a tip for you: In python you never use tabs for indentation.
>
> For some value of "you".
>
> > The python style guide [1] recommends four spaces per indentation
> > level.
> >
> > [1] http://www.python.org/dev/peps/pep-0008/
>
> It's not quite absolute on the topic:
>
>     For new projects, spaces-only are strongly recommended over tabs.

    Even if were, read the Introduction. This is a coding standard intended
to apply to code which is going to checked in as part of the core python
build, not all Python!  It's probably a pretty good standard to be following
in general, but come on... If Guido really wanted this enforced across the
board he could simply call anything that doesn't meet this standard to the
letter a SyntaxError and just stop there. For example, the standard states:

- Imports should usually be on separate lines, e.g.:

        Yes: import os
             import sys

        No:  import sys, os

>>> import sys, os
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Sorry, only one module per import line!


I'm sure that's not Guido's intention. ;)

-ej





More information about the Python-list mailing list