Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Why not enforce four space indentations in version 3.x?

Path: g2news2.google.com!news2.google.com!news.glorb.com!news-xfer.nntp.sonic.net!posts.news.sonic.net!nnrp1.nntp.sonic.net!not-for-mail
Date: Tue, 14 Jul 2009 11:06:17 -0700
From: John Nagle <na...@animats.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: comp.lang.python
Subject: Re: Why not enforce four space indentations in version 3.x?
References: <260f0f1f-1115-4db8-a955-74c9f459ecc3@h30g2000vbr.googlegroups.com>
In-Reply-To: <260f0f1f-1115-4db8-a955-74c9f459ecc3@h30g2000vbr.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 21
Message-ID: <4a5cc8c0$0$1655$742ec2ed@news.sonic.net>
Organization: Sonic.Net
NNTP-Posting-Date: 14 Jul 2009 18:04:49 GMT
NNTP-Posting-Host: bd485c67.news.sonic.net
X-Trace: DXC=6iAR50;DCkF7jmAoUKdoRGm4K\QM1CV^@1OYf0H`?;XAhN8H=?n=PEACbKOMTl_<bH0:lXUBYF02I
X-Complaints-To: abuse@sonic.net

walterbyrd wrote:
> I believe Guido himself has said that all indentions should be four
> spaces - no tabs.
> 
> Since backward compatibility is being thrown away anyway, why not
> enforce the four space rule?
> 
> At least that way, when I get python code from somebody else, I would
> know what I am looking at, without having to do a hex dump, or
> something.

    Python 3 enforces the rule that you can't mix tabs and spaces
for indentation in the same file.  That (finally) guarantees that
the indentation you see is what the Python parser sees.  That's
enough to prevent non-visible indentation errors.

    It also means that the Python parser no longer has to have
any concept of how many spaces equal a tab.  So the problem
is now essentially solved.

					John Nagle