Switch from print to debugger() and never look back!
Project description
Switch from print to debugger() and never look back.
Import this module in your main file to add debugger as a builtin command.
Calling debugger opens the ipdb debugger,
import debug debugger() # <-- breaks here
Calling debugger.disable from the ipdb prompt disables all breakpoints,
import debug debugger() # <-- breaks here # >> debugger.disable() # >> continue debugger() # <-- does not break here
Using debug.wrap sets a function breakpoint,
def fun(): pass def example(): fun() fun = debug.wrap(fun) example() # <-- breaks above at definition of fun
Using debug.sample collects arguments and return values,
def fun(a, b=None): return fun(42, 'hello worlds') debugger() # <-- breaks here >> len(fun.samples) 1 >> fun.samples [{0: 42, 'b': 'hello worlds', '$': 1764}]
Installation
To install this package, run
pip install print-considered-harmful
Contributing
Bug reports and pull requests are welcome on github at, https://github.com/akuhn/print-considered-harmful
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for print-considered-harmful-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55f7d2f4ff8f8d53ba1aff9e6cbb1e0a029a3ea1638a95cb0fa27fceebca4f5f |
|
MD5 | 5cb8bc42fb568f029a46846434e723ea |
|
BLAKE2b-256 | 1fa982798e37947fe906c9f998e8baf645d90bf77cc45da5816ef65f7a99e05a |