Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

I planned to add a table for end line numbers, so every instruction will be 
associated with a range of lines.

For example, in

  x = {
    a,
    b
  }

the BUILD_SET instruction will be associated with lines 1-4. Currently it is 
associated only with line 1, and was associated with line 3 in 3.7.

In

  x = (
    a
    +
    b
  )

the BINARY_ADD instruction will be associated with lines 2-4. Currently it is 
associated with line 2, and was associated with line 4 in 3.7. The proposition 
about associating it with line 3 (containing the "+" operator) was rejected 
before.

In

  x = (
    a
    .
    b
  )

the LOAD_ATTR instruction will be associated with lines 2-4. Currently it is 
associated with line 2. The AST does not contain information about lines of "." 
and "b" tokens, but it contains information about the start and the end 
positions of "a.b".

This will help tools like coverage.py which are confused be executing the same 
line several times and may allow to generate more informative tracebacks.

As for END_ASYNC_FOR, it will be associated with the range of the "async for" 
statement.

Maybe we could use more efficient format for encoding start and end line 
numbers.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39537>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to