PyDocs

Nav

Python Language Services

get_instructions

dis

function · Added in 3.4 (source)
  • get_instructions(x, *, first_line=None, show_caches=False, adaptive=False)
Iterator for the opcodes in methods, functions or code

Generates a series of Instruction named tuples giving the details of
each operations in the supplied code.

If *first_line* is not None, it indicates the line number that should
be reported for the first source line in the disassembled code.
Otherwise, the source line information (if any) is taken directly from
the disassembled code object.
Changed in 3.11, 3.13
  • 3.11: Added the show_caches and adaptive parameters.
  • 3.13: The show_caches parameter is deprecated and has no effect. The iterator generates the Instruction instances with the cache_info field populated (regardless of the value of show_caches) and it no longer generates separate items for the cache entries.
0 Examples
No examples for dis/get_instructions.
See Also
No see-alsos for dis/get_instructions
0 Notes
No notes for get_instructions