Skip to main content

PyBug extends Python's interactive debugger (pdb), making it simpler to add breakpoints to your code.

Project description

PyBug - python debugging utilities

PyBug extends Python's interactive debugger (pdb), making it simpler to add breakpoints to your code. Uses ipdb if available.

Usage examples:

# Like pdb.set_trace(), but shorter :) and works with nosetests.
import bug; bug.trace()

# Set a breakpoint at line 35 of package.module
bug.setbreak(35, "package.module")

# Set a conditional breakpoint at line 42 of /path/to/universe.py
bug.setbreak(42, "/path/to/universe.py", "name == 'hitchhiker'")

There are two notable features here that would ideally make it into the pdb module in the Python Standard Library:

  • Easily set a breakpoint at an arbitrary line in an arbitrary module. This is useful when debugging a third-party library where the code cannot easily be edited to add a set_trace() call.

  • Set a breakpoint in a module named by import path rather than file path.

Changes

1.2

  • Use ipdb if available

1.1

  • Fix trace() for proper readline support
  • Fix syntax error on Python 3

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 PyBug, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size PyBug-1.2.1-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size PyBug-1.2.1.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View hashes

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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page