ipdb-based debugger
Project description
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.
Installing
$ pip install ipdbugger
Using
from ipdbugger import debug
@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
6
ipdb> foo
2
ipdb>
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ipdbugger-2.4.1.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for ipdbugger-2.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a83cb7283f0865b3a51c9ac68b81c146808e06df0edd02f0101f2ff7bd6f204 |
|
MD5 | 691885800e4649ae8db46c28ef516ea9 |
|
BLAKE2b-256 | f5e94e53c021ad63d79562ec190f9e1d354587290bbd6c9f2ecb122bb5f6ce2c |