Tabbing/Spaces

Emile van Sebille emile at fenx.com
Fri Jan 19 21:11:55 EST 2001


"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.979955644.18879.python-list at python.org...
> [Robert L Hicks]
> > ...
> > While reading the reference manual it denotes that 8
spaces is
> > that standard for indentation.
>
> Where?  The Python compiler deals with a tab character by
moving to the next
> multiple-of-8 column, but that's just a (hardcoded) fact.
>

>From the Reference Manual:

2.1.7 Indentation
Leading whitespace (spaces and tabs) at the beginning of a
logical line is used to compute the indentation level of the
line, which in turn is used to determine the grouping of
statements.

First, tabs are replaced (from left to right) by one to
eight spaces such that the total number of characters up to
and including the replacement is a multiple of eight (this
is intended to be the same rule as used by Unix). The total
number of spaces preceding the first non-blank character
then determines the line's indentation. Indentation cannot
be split over multiple physical lines using backslashes; the
whitespace up to the first backslash determines the
indentation.

Glad-not-to-have-been-bit-by-the-time-machine-ly y'rs,


--

Emile van Sebille
emile at fenx.com
-------------------







More information about the Python-list mailing list