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

Function _find_lines

Lib/trace.py:341–351  ·  view source on GitHub ↗

Return lineno dict for all code objects reachable from code.

(code, strs)

Source from the content-addressed store, hash-verified

339 return linenos
340
341def _find_lines(code, strs):
342 """Return lineno dict for all code objects reachable from code."""
343 # get all of the lineno information from the code of this scope level
344 linenos = _find_lines_from_code(code, strs)
345
346 # and check the constants for references to other code objects
347 for c in code.co_consts:
348 if inspect.iscode(c):
349 # find another code object, so recurse into it
350 linenos.update(_find_lines(c, strs))
351 return linenos
352
353def _find_strings(filename, encoding=None):
354 """Return a dict of possible docstring positions.

Callers 1

_find_executable_linenosFunction · 0.85

Calls 2

_find_lines_from_codeFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…