On this page
dis.code_info
Prev: dis.Bytecode | Up: dis | Next: dis.dis
Rel: dis.Bytecode, dis.dis, dis.disassemble, dis.disco
Ref: docs.python.org — dis.code_info
Tags: #public #python3 #stdlib #dis
Import
import dis
from dis import code_info
Signature & Overview
dis.code_info(x)
Formatted details of methods, functions, or code.
Usage
import dis
info = dis.code_info(lambda x, y: x + y)
assert "Argument count:" in info and "Variable names:" in info
Gotchas
- Returns a
strsummary of stack size, flags, constants, and variable names (useshow_code()to print).
REPL Inspect
from dis import code_info
help(code_info)
Linked from
- tuts/python3/stdlib_module/dis
- tuts/python3/stdlib_module/dis/Bytecode
- tuts/python3/stdlib_module/dis/dis
- tuts/python3/stdlib_module/dis/disassemble
- tuts/python3/stdlib_module/dis/disco
- tuts/python3/stdlib_module/dis/distb
- tuts/python3/stdlib_module/dis/findlabels
- tuts/python3/stdlib_module/dis/findlinestarts
- tuts/python3/stdlib_module/dis/get_instructions
- tuts/python3/stdlib_module/dis/Instruction
- tuts/python3/stdlib_module/dis/show_code
- tuts/python3/stdlib_module/dis/stack_effect
Related notes
- tuts/python3/stdlib_module/dis/Bytecode Linked here; links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/dis Linked here; links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/disassemble Linked here; links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/disco Linked here; links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/distb links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/findlabels links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/findlinestarts links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/get_instructions links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/Instruction links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/show_code links to this page; shared tags: #dis, #stdlib