Skip to main content

ipdb-based debugger

Project description

PyPI Python versions

ipdbugger is a code debugging tool based on ipdb.

Use the debug decorator on functions or classes to debug them. What actually happens: it surrounds each statement of the functions with a try-except, and starts an ipdb session in the exception handling section.


$ pip install ipdbugger


from ipdbugger import debug

def f():
    foo = 1 + 1
    bar = 1 / 0
    baz = 2 + 2

Now when you run f(), you’ll get into an ipdb shell right after the error (the division by zero):

>>> from ipdbugger import debug
>>> @debug
    def f():
        foo = 1 + 1
        bar = 1 / 0
        baz = 2 + 2

>>> f()
Traceback (most recent call last):
   File "<ipython-input-2-5720bb02ab1d>", line 4, in f
    bar = 1 / 0
 ZeroDivisionError: integer division or modulo by zero
> <ipython-input-2-5720bb02ab1d>(5)f()
      2 def f():
      3     foo = 1 + 1
      4     bar = 1 / 0
----> 5     baz = 2 + 2

ipdb> foo

From there, you have a couple of choices:

  • retry the action
  • continue with the rest of the flow (and ignore the error)
  • raise the exception, as if you didn’t catch it at all
  • Use any other of the available ipdb commands, like jump

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ipdbugger, version 2.5.0
Filename, size & hash File type Python version Upload date
ipdbugger-2.5.0-py2.py3-none-any.whl (7.8 kB) View hashes Wheel py2.py3
ipdbugger-2.5.0.tar.gz (6.8 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page