On this page
dis.distb
Prev: dis.disco | Up: dis | Next: dis.findlabels
Rel: dis.Bytecode, dis.code_info, dis.dis, dis.disassemble
Ref: docs.python.org — dis.distb
Tags: #public #python3 #stdlib #dis
Import
import dis
from dis import distb
Signature & Overview
dis.distb(tb=None, *, file=None, show_caches=False, adaptive=False, show_offsets=False, show_positions=False)
Disassemble a traceback (default: last traceback).
Usage
import dis
import io
buf = io.StringIO()
try:
1 / 0
except ZeroDivisionError as exc:
dis.distb(exc.__traceback__, file=buf)
assert "-->" in buf.getvalue()
Gotchas
- Marks the exact failing bytecode instruction with
-->from a traceback.
REPL Inspect
from dis import distb
help(distb)
Linked from
Related notes
- tuts/python3/stdlib_module/dis/disco Linked here; links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/findlabels Linked here; links to this page; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/Bytecode Linked here; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/code_info Linked here; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/dis Linked here; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/disassemble Linked here; shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/dis/findlinestarts shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/get_instructions shared tags: #dis, #stdlib
- tuts/python3/stdlib_module/dis/Instruction shared tags: #dis, #stdlib