PyDocs

Nav

Python Language Services

findlinestarts

dis

function (source)
  • findlinestarts(code)
Find the offsets in a byte code which are start of lines in the source.

Generate pairs (offset, lineno)
lineno will be an integer or None the offset does not have a source line.
Changed in 3.6, 3.10, 3.13
  • 3.6: Line numbers can be decreasing. Before, they were always increasing.
  • 3.10: The PEP 626 co_lines() method is used instead of the co_firstlineno and codeobject.co_lnotab attributes of the code object.
  • 3.13: Line numbers can be None for bytecode that does not map to source lines.
0 Examples
No examples for dis/findlinestarts.
See Also
No see-alsos for dis/findlinestarts
0 Notes
No notes for findlinestarts