This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients dmi.baranov, ezio.melotti, flox, georg.brandl, giampaolo.rodola, icordasc, lesmana, ncoghlan, petri.lehtinen, psss, r.david.murray, terry.reedy
Date 2013-04-30.17:19:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
OK, you would make tracebacks even longer by adding lines that might or might not be be useful. Suppose the error is not the assertion itself, but in one of the expressions (in this case, being compared for equality):
Or reverse the two expressions, or replace the method call with an assert statement and join the expressions with '=='. Would you still print both lines?

My experience on python-list is that people more often have a problem with a whole line being too much context, not too little. Someone writes 'print(complicated_expression)' and gets a Unicode error. Is the problem the expression or the printing of the result to a limited charset console? Both cases have been posted. I sometimes advise people to break their elegant one-liners into two or more lines to make the actual error expression more obvious. If we were to revise the CPython compiler and traceback generator, that is what I think the aim should be. Such a change would include printing multiple lines when the expression spans multiple lines. This might have to be limited to debug builds.
Date User Action Args
2013-04-30 17:19:03terry.reedysetrecipients: + terry.reedy, georg.brandl, ncoghlan, giampaolo.rodola, ezio.melotti, psss, r.david.murray, flox, lesmana, petri.lehtinen, icordasc, dmi.baranov
2013-04-30 17:19:03terry.reedysetmessageid: <>
2013-04-30 17:19:03terry.reedylinkissue12458 messages
2013-04-30 17:19:03terry.reedycreate