Python 3.14+pdbfunction
pdb.set_default_backend()
backend
Sets the backend for new Pdb instances: 'settrace' (the default) or 'monitoring', built on sys.monitoring.
Syntax
pdb.set_default_backend(backend)
The 'monitoring' backend (PEP 669) barely slows code outside breakpoints, while 'settrace' traces every line. The setting affects only Pdb() instances created without backend=; breakpoint() and set_trace() always use 'monitoring'. Any other name raises ValueError. Added in Python 3.14.
Examples
import pdb
pdb.set_default_backend('monitoring')
print(pdb.Pdb(readrc=False).backend) # → monitoring
try:
pdb.set_default_backend('fast')
except ValueError as e:
print(e) # → Invalid backend: fast
See also
Common errors
Open in the full glossarydocs.python.orgReport an inaccuracy