change Python error messages for continued lines?

B

beliavsky

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top