← All notes

pdb is Python's interactive source debugger, and breakpoint() is the usual way to enter it

Answer: The pdb module is an interactive source code debugger for Python. It supports conditional breakpoints, single stepping, stack inspection, source listing, and evaluating code in a stack frame. It also supports post-mortem debugging. The typical way to break into it is to insert breakpoint().

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: python/cpython (GitHub), pdb — The Python Debugger (CPython docs source), PSF-2.0 (https://raw.githubusercontent.com/python/cpython/main/LICENSE); Python Software Foundation (docs.python.org), pdb — The Python Debugger, PSF-2.0 (https://docs.python.org/3/license.html). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: python/cpython (GitHub), pdb — The Python Debugger (CPython docs source), PSF-2.0 (https://raw.githubusercontent.com/python/cpython/main/LICENSE); Python Software Foundation (docs.python.org), pdb — The Python Debugger, PSF-2.0 (https://docs.python.org/3/license.html).

Cite this

Permanent ID: iil:note:mejce2d4

iinventedlight. 2026. "pdb is Python's interactive source debugger, and breakpoint() is the usual way to enter it." iinventedlight Library, iil:note:mejce2d4, version of 2026-11-18. https://iinventedlight.com/library/notes/python-pdb/. License: CC-BY-4.0.

@misc{iil_note_mejce2d4,
  author = {{iinventedlight}},
  title = {{pdb is Python's interactive source debugger, and breakpoint() is the usual way to enter it}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/python-pdb/},
  note = {Permanent ID iil:note:mejce2d4. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-pdb.md.