Description
Feature or enhancement
Proposal:
We have a co_firstlineno
in code object which is useful in many cases. However, co_lastlineno
is very useful as well. With the two numbers we can get the full body of the defined function, rather than doing something crazy like:
Lines 1194 to 1211 in 13a5fdc
Not only inspect
will benefit from the number, pdb
will know whether a breakpoint is set in the function easily so it can turn off the trace in irrelevant functions.
I'm not the expert in compiler but I think the data should be there already, we just need to write it down. The code object itself is not super size sensitive (it's already pretty big, an extra integer is nothing) so it really should not cost anything.
@iritkatriel could you share your thoughts on this?
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response