Message354847
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. |
|
Date |
User |
Action |
Args |
2019-10-17 15:26:05 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, fabioz |
2019-10-17 15:26:05 | serhiy.storchaka | set | messageid: <1571325965.86.0.700110684324.issue38508@roundup.psfhosted.org> |
2019-10-17 15:26:05 | serhiy.storchaka | link | issue38508 messages |
2019-10-17 15:26:05 | serhiy.storchaka | create | |
|