
On 22Jul2020 1319, Mark Shannon wrote:
On 21/07/2020 9:46 pm, Gregory P. Smith wrote:
Q: Why can't we have the information about the entire span of lines rather than consider a definition to be a "line"?
Pretty much every profiler, coverage tool, and debugger ever expects lines to be natural numbers, not ranges of numbers. A lot of tooling would need to be changed.
As someone who worked on apparently the only debugger that expects _character_ ranges, rather than a simple line number, I would love to keep full mapping information somewhere. We experimented with some stack analysis to see if we could tell the difference between being inside the list comprehension vs. outside the comprehension, or which of the nested comprehension is currently running. But it turned out to be too much trouble. An alternative to lnotab that includes the full line/column range for the expression, presumably taken from a particular type of node in the AST, would be great. But I think omitting even line ranges at this stage would be a missed opportunity, since we're breaking non-Python debuggers anyway. Cheers, Steve