PyNom
A simple library to eat exceptions, until enough of a given exception type has been raised. The name has the word 'Nom' in it because it can sometimes sound like a person eating.
Installation
pip install pynom
Simple Usage Example
from pynom import PyNom
pn = PyNom([ValueError], 5)
while True:
# This block will raise after 5 (so on the 6th) ValueErrors.
# It will raise an Exception containing tracebacks, exceptions, approx timestamps for each ValueError
# If a non-ValueError is raised, it will be immediately raised (and not eaten)
with pn:
do_something()
Advanced Usage Example
from pynom import PyNom
pn = PyNom([ValueError], 5, throw_up_action=lambda ex: print(ex))
while True:
# On the 6th value error will call the given throw_up_action
# a CombinedException will be passed to the throw_up_action.
with pn:
do_something()
See https://csm10495.github.io/pynom/ for full API documentation.
License
MIT License
Metadata
Release files for pynom 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pynom-0.0.11.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynom-0.0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / pynom-0.0.11.tar.gz
| Download URL | pynom-0.0.11.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fac0abb5f3979a44ef22227930b97a101c42a608ce50837c646b13349aecb321
|
|
BLAKE2b-256 checksum How to use checksums |
f3537fd27eaaed2b18334718256794b22747d40eb1ee0d245131bce9905ced8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / pynom-0.0.11-py3-none-any.whl
| Download URL | pynom-0.0.11-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e2aa59aff6649d2ef8a3fb025857f919897668ee1c6d2da4190b765a2c81d3f
|
|
BLAKE2b-256 checksum How to use checksums |
081241f1351f4f1813a520195a2662864ce90f2bff66f2d53c2505fd165afbb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|