Whitespace as syntax (was Re: Python Rocks!)

Quinn Dunkan quinn at zloty.ugcs.caltech.edu
Wed Feb 9 20:05:35 CET 2000


On Wed, 09 Feb 2000 04:55:33 GMT, fcahoon at my-deja.com <fcahoon at my-deja.com>
wrote:
>I'm more concerned about the possiblilty of one bad line being left in a
>infrequently-executed routine, leading to spurious errors which are
>difficult to track down.

So let's suppose you managed to delete a space somehow in an infrequently
exectuted routine.  python immediately throws a syntax error at you with a
line number.  Not very difficult to track down.  Now suppose you somehow
manage to delete exactly enough spaces to make something syntactically valid.
Now your function has a bug.  But fortunately, you always test your functions,
so it's found just like that time you accidentally managed to delete some
important parentheses.  And the time you got the logic backwards on an if
then.

Ok, so you've stated that, while you like python, this possibility worries
you.  Your worry is duly noted.  Now go write some python.

Many others have said this, but I will any way: In my experience with python,
I've *never* had this problem.  I've written lots of syntax errors, I've
written plenty of subtle and not-so-subtle invalid code.  I've stumbled around
in many people's python code, some of whom had truly strange ideas of how many
spaces there are in a tab.  I've never had a whitespace problem.  I've never
even seen a file with mixed tabs and spaces, let alone one with tabs != 8.
And if I did, I would simply use the vim :retab command.

So stop worrying already.  Or at least worry quietly, to yourself :)



More information about the Python-list mailing list