Whitespace as syntax (was Re: Python Rocks!)

Thomas Wouters thomas at xs4all.net
Tue Feb 8 04:45:28 EST 2000


On Tue, Feb 08, 2000 at 09:19:50AM +0000, Thomas Hamelryck wrote:
> Roy Smith <roy at popmail.med.nyu.edu> wrote:
> : I'm a hard-core python addict, and I agree 100% with fcahoon.  This 
> : sillyness with indenting for statement grouping is without a doubt the 
> : most serious blemish on the language.

> I am in exactly the same position. It was a serious design error.
> I wonder how the CP4A people are going to explain to complete
> computer illiterates that a python program can contain errors that
> are _not even visible_ when you look at the code. 

It was obviously not a design error -- a lot of people like it. As for how
CP4E is going to solve it -- probably by telling people not to mix tabs and
spaces. Tabs are great, I usually use tabs. But tabs are 8 spaces, period.
If you want less indentation, use spaces -- do not shrink tabs.

(Unless, of course, everyone uses tabs, and only tabs.)

As has been said before, indentation is NOT invisible. If it is invisible
(ie, spaces/tabs with no visible characters following) then the python
parser doesn't care about it, either. The only thing that is confusing and
invisible is the difference between tabs and spaces. The least you can do
when editing someone else's python code is check how he/she does his/her
indentation, and match that. But even that isn't too necessary, as long as
you check that tabs are always eight spaces.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list