change Python error messages for continued lines?

beliavsky at aol.com beliavsky at aol.com
Thu Jul 8 16:01:26 EDT 2004


I have noticed a quirk of Python error messages that I think should be
changed.
The code

x = 1
print x,\
      y

produces output 

1
Traceback (most recent call last):
  File "xerr.py", line 2, in ?
    print x,\
NameError: name 'y' is not defined

which is confusing at first because 'print x,\' does not contain a
'y'. When a Python error message prints a line that spans more than
one line of text, I think the entire line should be printed.



More information about the Python-list mailing list