On this page
  1. dis.Instruction
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

dis.Instruction

Prev: dis.get_instructions | Up: dis | Next: dis.show_code
Rel: dis.Bytecode, dis.code_info, dis.dis, dis.disassemble
Ref: docs.python.org — dis.Instruction
Tags: #public #python3 #stdlib #dis


Import

import dis
from dis import Instruction

Signature & Overview

dis.Instruction(opname, opcode, arg, argval, argrepr, offset, start_offset, starts_line, line_number, label=None, positions=None, cache_info=None)

Details for a bytecode operation.

Methods & Attributes

Usage

import dis

ins = next(dis.get_instructions(lambda x: x))
assert isinstance(ins, dis.Instruction) and isinstance(ins.opname, str)

Gotchas

REPL Inspect

from dis import Instruction
help(Instruction)

Linked from

Related notes