Why not enforce four space indentations in version 3.x?

Jean-Michel Pichavant jeanmichel at sequans.com
Wed Jul 15 11:00:39 EDT 2009


John Nagle wrote:
> 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
By the way why would you prevent us from using tabs for indenting ? If 
I'm not wrong, from a semantic point of view, that's what tabs are for: 
indenting. Spaces are meant to separate tokens, aren't they ?
I love my tabs, don't take them away from me !

JM



More information about the Python-list mailing list