pdbp (Pdb+)
pdbp (Pdb+) is a Python debugger designed as a drop-in replacement for the standard `pdb` and the enhanced `pdbpp` debuggers. It aims to provide an improved debugging experience with additional features and better usability, including syntax highlighting and more powerful commands. As of version 1.8.2, it maintains an active release cadence with frequent updates for bug fixes, new Python version support, and feature enhancements.
Warnings
- breaking Support for Python 3.7 was dropped in `pdbp` v1.6.0. Users on Python 3.7 or older will need to use an earlier version of `pdbp` or upgrade their Python interpreter.
- gotcha Older versions of `pdbp` (prior to v1.5.4) had compatibility issues when used with `PyInstaller` due to non-zip-safe loading of the standard library `pdb`. This could lead to errors when bundling applications.
- gotcha `pdbp` v1.7.1 included updates to support changes made in `pytest` v8.4.0+ for Python 3.13+. If you are using these newer versions of `pytest` and Python, older `pdbp` versions might exhibit compatibility problems with the debugger integration.
- gotcha `pdbp` v1.8.2 repaired an issue with stack-trace frame indexing. Prior versions might have displayed incorrect or confusing frame indices, potentially leading to misinterpretations of the call stack during debugging.
Install
-
pip install pdbp
Imports
- set_trace
import pdbp; pdbp.set_trace()
Quickstart
import pdbp
def my_function(x, y):
print(f"Before addition: x={x}, y={y}")
pdbp.set_trace() # The debugger will pause execution here
result = x + y
print(f"After addition: result={result}")
return result
if __name__ == '__main__':
print("Starting program...")
my_function(5, 3)
print("Program finished.")