A Bug By Any Other Name ...

J. Cliff Dyer jcd at sdf.lonestar.org
Fri Jul 17 16:08:26 EDT 2009


On Fri, 2009-07-17 at 20:53 +0000, Albert van der Horst wrote:
> Because unlike in algol 68 in python whitespace is relevant,
> we could get by with requiring whitespace:
>         x= -q                       # okay
>         a<b and -a<c and -b < -d    # okay
>         8 ** -2                     # okay

This is actually quite thoroughly untrue.  In python, *indentation* is
significant.  Whitespace (internal to a line) is not.  You can even call
methods like this if you want:

>>> s = 'abc'
>>> s        .     upper()
ABC

Obviously, that's A Bad Idea(tm), but python's parser won't stop you.
The ++ operator gotcha is so minor that I can't remember anyone actually
asking about it on the list (who was actually facing it as a
problem--this thread was started by idle speculation).  Can we not
change the language syntax to address non-issues?

Practicality beats purity, a.k.a. don't you have something better to do?


Cheers,
Cliff






More information about the Python-list mailing list