Safe
This is quite a simple package. It catches all exceptions within a given callable and returns None, if they occur and the return-value of the callable if not.
def boom():
raise Exception()
return 1
def non_boom():
return 2
a = safe(lambda: boom())
b = safe(lambda: non_boom())
assert a == None
assert b == 2
Metadata
Release files for exception-safe 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| exception_safe-0.0.3.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| exception_safe-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / exception_safe-0.0.3.tar.gz
| Download URL | exception_safe-0.0.3.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ef879cd1d34136244e150b7b897e7e37458da52e601c8b1b7e588e6a2d9b012
|
|
BLAKE2b-256 checksum How to use checksums |
d73eadf4613fc5a829fdcd1a552233e41940e8c431eba8c8df5c589a55f71adc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Release files / exception_safe-0.0.3-py3-none-any.whl
| Download URL | exception_safe-0.0.3-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46648f78d24c3bc6b1d2963e74346506a5a045f3f27ed9284229a410ef124570
|
|
BLAKE2b-256 checksum How to use checksums |
d0db44193f797c1d509db5192e6972102b1ed6f3b4b30c0dd0f8a61a6d1b8437
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|