dis
Stdlib — IntrospectionPython 2.0+Expert
Disassemble Python bytecode to human-readable instructions
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
- Dependencies
- None — Python Standard Library
- Install
Included with Python
Learn by Difficulty
Quick Example
python
import dis def example(x, y): return x + y * 2 print("Bytecode for 'x + y * 2':") dis.dis(example)
The dis module is part of Python's standard library. Disassemble Python bytecode to human-readable instructions.
Try in PlaygroundTags
stdlibintrospectionbytecodeinternals
Related Items
ast
Stdlib — Introspection
Parse Python source into an Abstract Syntax Tree
inspect
Stdlib — Introspection
Inspect live objects: source code, signatures, class hierarchies
compile()
Built-in Function
Compiles source code into a code object for exec() or eval()
CPython
Python Runtime
The reference Python implementation written in C; what you get from python.org