MCPcopy Index your code
hub / github.com/python/cpython / lasti2lineno

Function lasti2lineno

Lib/pdb.py:167–173  ·  view source on GitHub ↗
(code, lasti)

Source from the content-addressed store, hash-verified

165 return None
166
167def lasti2lineno(code, lasti):
168 linestarts = list(dis.findlinestarts(code))
169 linestarts.reverse()
170 for i, lineno in linestarts:
171 if lasti >= i:
172 return lineno
173 return 0
174
175
176class _rstr(str):

Callers 1

setupMethod · 0.85

Calls 2

listClass · 0.85
reverseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…