En Mon, 22 Jun 2009 20:34:40 -0300, Miles Kaufmann <mile...@umich.edu>
escribió:
On Jun 22, 2009, at 12:14 AM, Ben Charrow wrote:
What is subtly wrong about this piece of code? I can't see any bugs
and can't think of subtle gotchas (e.g. the '\' is removed or the lines
become separated, because in both cases an IndentationError would be
raised).
Perhaps, along with one of those gotchas, a mix of tabs and spaces are
used such that the second line only _appears_ to have a different level
of indentation? ;)
Neither. As back in time as I can go (Python 1.5), having any character
after the backslash has always been a syntax error no matter what. Only
the error message has changed:
C:\TEMP>python15 syntaxerror.py
File "syntaxerror.py", line 18
value = foo.bar()['first'][0]*baz.quux(1, 2)[5:9] \
^
SyntaxError: invalid token
So the "it might be subtly wrong" argument is strongly wrong.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list