Are Python's reserved words reserved in places they dont need to be?
metaperl at gmail.com
Wed Sep 13 01:43:18 CEST 2006
Istvan Albert wrote:
> metaperl wrote:
> > --> python -i
> > >>> class = "algebra"
> > File "<stdin>", line 1
> > class = "algebra"
> > ^
> > SyntaxError: invalid syntax
> Designing a syntax to avoid all possible newbie errors is impractical
> because as soon as you are finished with one iteration the new newbies
> will start making different kinds of errors...
You are missing the point: the point is that the above could be
considered correct if the rules of Python were that an assignment
IDENTIFIER '=' LVALUE
Also "class" IDENTIFIER COLON could also be considered correct.
> Take solace in the fact that you've been immediately notifed of the
> error while its fix: renaming pass to passwd is trivial ...
Again in certain automatic mapping circumstances (ORMs being the most
obvious, CSV to Python data another), it is not always convenient or
desirable or semantically articulate to do so.
More information about the Python-list