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

Function _get_code_position

Lib/traceback.py:440–444  ·  view source on GitHub ↗
(code, instruction_index)

Source from the content-addressed store, hash-verified

438
439
440def _get_code_position(code, instruction_index):
441 if instruction_index < 0:
442 return (None, None, None, None)
443 positions_gen = code.co_positions()
444 return next(itertools.islice(positions_gen, instruction_index // 2, None))
445
446
447_RECURSIVE_CUTOFF = 3 # Also hardcoded in traceback.c.

Callers 1

Calls 1

isliceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…