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
Built Distribution
File details
Details for the file ipdbugger-2.0.2.tar.gz
.
File metadata
- Download URL: ipdbugger-2.0.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8b7d119521b280f2e82264d30293784afa32261e6f00b612f71c0317d7c576b |
|
MD5 | 5f632d8b9eec3630cdd9e1ef8f4da016 |
|
BLAKE2b-256 | af1c5a2a2642390e0c6da09eafa43725c9d3a75283dac5f76b1bed82035c2ddc |
File details
Details for the file ipdbugger-2.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: ipdbugger-2.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a19fc3754cd0e7762c344ed5883624e21a73b0c635efbacd835b21f24ce611 |
|
MD5 | 2ddf1ddb9b7b9889ae29ed2af96d4e6b |
|
BLAKE2b-256 | 7de9f10e314fae0d3faba74708d577450a6b4a5f0602483f64cc6f9a8d90edad |