On this page
pdb.set_trace
Prev: pdb.set_default_backend | Up: pdb
Rel: pdb.get_default_backend, pdb.help, pdb.Pdb, pdb.pm
Ref: docs.python.org — pdb.set_trace
Tags: #public #python3 #stdlib #pdb
Import
import pdb
from pdb import set_trace
Signature & Overview
pdb.set_trace(*, header=None, commands=None)
Enter the debugger at the calling stack frame.
Usage
import pdb
# Prefer built-in breakpoint() in Python 3.7+ (which honors PYTHONBREAKPOINT=0)
assert callable(pdb.set_trace)
Gotchas
- Prefer
breakpoint():breakpoint()can be disabled globally viaPYTHONBREAKPOINT=0without editing code.
REPL Inspect
from pdb import set_trace
help(set_trace)
Linked from
Related notes
- tuts/python3/stdlib_module/pdb/set_default_backend Linked here; links to this page; shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/get_default_backend Linked here; shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/help Linked here; shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/Pdb Linked here; shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/pm Linked here; shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/pdb/post_mortem shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/run shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/runcall shared tags: #pdb, #stdlib
- tuts/python3/stdlib_module/pdb/runctx shared tags: #pdb, #stdlib