Python Glossary Русский

Python 3.14+pdbfunction

pdb.get_default_backend()

backend

Returns the name of the backend new Pdb instances are created with: 'settrace' or 'monitoring'.

Syntax

pdb.get_default_backend()

Until set_default_backend() is called the answer is 'settrace', even though breakpoint() runs on 'monitoring': the default covers only Pdb() instances created without backend=. The value is global to the process, so a library that changes it changes it for your code too. Added in Python 3.14.

Examples

import pdb
print(pdb.get_default_backend())  # → settrace
pdb.set_default_backend('monitoring')
print(pdb.get_default_backend())  # → monitoring

See also

Open in the full glossarydocs.python.orgReport an inaccuracy