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

Function instructions_with_positions

Lib/test/support/bytecode_helper.py:14–24  ·  view source on GitHub ↗
(instrs, co_positions)

Source from the content-addressed store, hash-verified

12_UNSPECIFIED = object()
13
14def instructions_with_positions(instrs, co_positions):
15 # Return (instr, positions) pairs from the instrs list and co_positions
16 # iterator. The latter contains items for cache lines and the former
17 # doesn't, so those need to be skipped.
18
19 co_positions = co_positions or iter(())
20 for instr in instrs:
21 yield instr, next(co_positions, ())
22 for _, size, _ in (instr.cache_info or ()):
23 for i in range(size):
24 next(co_positions, ())
25
26class BytecodeTestCase(unittest.TestCase):
27 """Custom assertion methods for inspecting bytecode."""

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…