'difference between ipdb and pdb++?
Python has its default debugger called pdb, but there are a few alternatives created by the community. Two of them are ipdb and pdb++. They seem to cater to the same audience, they can both be run directly at the CLI and provide some niceties such as colored output and tab-completion.
Do they serve different purposes or are they simply competing debuggers with similar features? I'm having trouble understanding when one would wish to use one over the other. There seem to even be people using both at the same time
Solution 1:[1]
I'm not a pdbpp
expert, but to me ipdb
comes with more features (IPython has many "magic" functions such as %timeit, %debug, etc that are handy), while pdbpp
has a sticky
mode that displays the source in the terminal as you step through (like GDB's TUI mode) and is more capable than the default pdb
.
So they are both good options to debug, but my personal preference goes to ipdb
because I'm used to work interactively from IPython. I've found I could set my main debugger to ipdb
like so:
export PYTHONBREAKPOINT=ipdb.set_trace # or ipdb.sset_trace
And put breakpoint()
in the Python source to debug. If pdbpp
is also installed, I can invoke sticky
from the ipdb
session, which is neat.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Apteryx |