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 serhiy.storchaka
Recipients fabioz, serhiy.storchaka
Date 2019-10-17.15:26:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571325965.86.0.700110684324.issue38508@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-10-17 15:26:05serhiy.storchakasetrecipients: + serhiy.storchaka, fabioz
2019-10-17 15:26:05serhiy.storchakasetmessageid: <1571325965.86.0.700110684324.issue38508@roundup.psfhosted.org>
2019-10-17 15:26:05serhiy.storchakalinkissue38508 messages
2019-10-17 15:26:05serhiy.storchakacreate