Whitespace as syntax (was Re: Python Rocks!)

wolf at one.net wolf at one.net
Wed Feb 9 17:22:54 EST 2000


fcahoon at my-deja.com wrote:

>Suppose that I'm one of those set-tabs-to-logical-indentation sorts of
>guys, so I set my tab width to 4, then look at this code in my editor.
>Gee, it sure _looks_ like statement4 belongs to "if condition1"!  And,
>if I convert tabs to spaces when I save, statement4 _will_ belong to "if
>condtion1".  I've just unwittingly changed the logic of the code!
>
>You may, of course, argue that this is unlikely, but it is still
>plausible enough to make me _very_ nervous.

You know, tabs in Python code are really not a good idea. :) You
should use an editor that converts tabs to spaces when you press the
tab key.

ScopeEdit, for instance, does this. So does E! No tabs, no possible
ambiguity!

Respectfully,

Wolf

"The world is my home, it's just that some rooms are draftier than
others". -- Wolf



More information about the Python-list mailing list