Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
Considering the code as: x = { 1, 2 } It first gets constant 1. Then gets constant 2. Then build a set. Then assign it to the variable. Obviously that the variable is assigned at line 1, so you would get a backward line in any case. The set display is multiline, it occupies lines 1 to 4. What line should be reported? In many cases it is more convenient to take a first line of the multiline expression. If the building a set failed (for example if items are not hashable) you will a line "x = {" in the traceback instead of just "}". This is not a bug, but a feature. In future perhaps tracing and traceback will get a range instead of a single line for multiline expressions, but it requires significant changes in the code. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38508> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com