A printing debugging helper.
Project description
dprint
A printing debugging helper.
Motivation
dprint is inspired by a python-ideas thread, to show what's possible
with a little bit of magic with plain Python code.
Installation
It's on PyPI as dprint. The obvious way will just work:
pip install dprint
Usage
Import the function dprint from the dprint module.
from dprint import dprint
def spam():
eggs = 10
dprint(eggs * 2)
spam()
Running the above script gives:
$ python script.py
script.py:6 in spam
eggs * 2 -> 20
Operational Assumptions
The current logic for figuring out the expression passed to dprint operates under some assumptions:
- The imported function must be called
dprint - A call should span no more than 1 line
- No more than 1 call on 1 line
A future version might relax these assumptions.
License
All files in this repository are under the MIT license.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dprint-0.1.0.tar.gz.
File metadata
- Download URL: dprint-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
103af899be7f27a0be60cd16ae6cd3a86548e29057067a79ad6e14091c0b0a1b
|
|
| MD5 |
edb7434d23c4a5f6666bca1b4a770d7e
|
|
| BLAKE2b-256 |
2116008612c155e93b66e384ae2eba946f158afdecac232254a3b8062e61593d
|
File details
Details for the file dprint-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: dprint-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbb814f9fbf4d22e1bd17e7c7ce397ba23ac7fba62439faa4272a0975b0f24d1
|
|
| MD5 |
2c369a5fd5b6cb2336117c9f1f8775e8
|
|
| BLAKE2b-256 |
001ed83f6d2f0ec1bcc4140a6865e462ea232ba80854aafb4d7af97ac72adc04
|