Skip to content
Python implementation of the Rust `dbg` macro
Python
Branch: master
Clone or download
tylerwince Merge pull request #12 from besfahbod/dev
pydbg: Write to stderr instead of stdout
Latest commit 8cf7985 Feb 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests pydbg: Write to stderr instead of stdout Feb 8, 2019
.gitignore
.travis.yml
LICENSE lawyer up Jan 21, 2019
README.md added contributors to README Jan 29, 2019
pydbg.py
setup.py pydbg: Write to stderr instead of stdout Feb 8, 2019

README.md

pydbg 🐛 Build Status

pydbg is an implementation of the Rust2018 builtin debugging macro dbg.

The purpose of this package is to provide a better and more effective workflow for people who are "print debuggers".

pip install pydbg

from pydbg import dbg

The old way:

a = 2
b = 3

print(f"a + b after instatiated = {a+b}")

def square(x: int) -> int:
    return x * x

print(f"a squared with my function = {square(a)}")

outputs:

a + b after instatiated = 5
a squared with my function = 4

The new (and better) way

a = 2
b = 3

dbg(a+b)

def square(x: int) -> int:
    return x * x

dbg(square(a))

outputs:

[testfile.py:4] a+b = 5
[testfile.py:9] square(a) = 4

This project is a work in progress and all feedback is appreciated.

The next features that are planned are:

  • Fancy Mode (display information about the whole callstack)
  • Performance Optimizations
  • Typing information

CONTRIBUTORS:

Thanks to everyone who has submitted an issue or thoughts on this project. Special thanks to those who have submitted a PR to make this project better for everyone:

You can’t perform that action at this time.