From python-dev, space vs. tab controversy finally settled

Carl Banks imbosol at aerojockey.invalid
Thu Apr 1 02:23:13 EST 2004


Here's a summary of the final decision Guido made concerning how
Python will indent code in the future, from python-dev:

Guido had been planning to deprecate tabs in favor of spaces for
awhile, although there have been good arguments for both tabs and
spaces.  But he was never really comfortable pulling the rug out from
half the user base.  However, today he finally decided on a compromise
that has all the benefits of both spaces and tabs.

His decision was predicated by the recent decision of the Unicode
Consortium to allocate some new codes for special use in programming
languages.  The Consortium allocated codes for (among other things):
several sets of left and right braces, several sets of quote
characters, a couple universal comment markers, and several
metacharacters for use in regular expressions.

However, the code that influenced Guido was a special indent code.
Here's how it works: at the beginning of the line, you put in one
"indent character" for each level of indentation.  Because Python will
support Unicode fully by 3.0, Guido decided that this new Unicode
character will be the one and only way to indent Python code.

Now, I'm sure everyone's aware that Unicode is getting kind of full,
and so, rather than allocating precious ununsed slots to the new
programming characters, the Consortium decided reallocate some codes
that had been rarely used.  These codes fall in the range 0001 through
001F, excepting 000A and 001A (all codes in hexadecimal).  The new
indent character has code 0009.

So, you should start using Unicode character 0009 to indent right
away.  Python 2.4 will deprecate all indentation not using the new
indent character, and Python 3.0 will not support any other
indentation.


-- 
CARL BANKS                      http://www.aerojockey.com/software
"If you believe in yourself, drink your school, stay on drugs, and
don't do milk, you can get work." 
          -- Parody of Mr. T from a Robert Smigel Cartoon



More information about the Python-list mailing list