[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

If it's a feature and not a bug, seems ok to me (I reported mainly because I 
thought the behavior was odd, but I guess it makes sense).

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Serhiy Storchaka


Serhiy Storchaka  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Fabio Zadrozny


New submission from Fabio Zadrozny :

When creating a multi-line list it seems that there's an additional line event 
that goes back to the start of the list.

i.e.: considering the code as:

[
1,
2
]

when stepping through the list, a debugger would get a line event at the `1` 
then at `2` and then at `['.

I'm attaching a sample code which prints the traced lines, where it's possible 
to see that there's a line event that goes backward to the list creation there 
(note that on Python 3.7 there's no line event for the list creation).

--
components: Interpreter Core
files: snippet33.py
messages: 354845
nosy: fabioz
priority: normal
severity: normal
status: open
title: Tracing events anomaly when creating a multi-line list
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48665/snippet33.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com