Capture side effects, safely.
Project description
Safely
Capture side effects, safely ⚔️
Installation
pip install safely
Usage
As a function (without second-order arguments):
def f(...): ...
result = safely(f)(...)
As a function (with second-order arguments):
def f(...): ...
result = safely(f, logger=logger.error, message="{exc_type}: {exc_value}")(...)
As a decorator (without second-order arguments):
@safely
def f(...): ...
result = f(...)
As a decorator (with second-order arguments):
@safely(logger=logger.error, message="{exc_type}: {exc_value}")
def f(...): ...
result = f(...)
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
safely-0.2.1.tar.gz
(3.6 kB
view details)
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 safely-0.2.1.tar.gz.
File metadata
- Download URL: safely-0.2.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.9.13 Linux/5.15.0-1019-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c65b5e6eaf9419cf7b54d7f7ea699e6e09d3b57eb2fde05fa8047a848c44bca
|
|
| MD5 |
386db5924bd2affa502dcdf95cfed2e6
|
|
| BLAKE2b-256 |
69f043ae67b1fba1de87d4e695982980e1a351c3d92d4c013b5a8b338423a847
|
File details
Details for the file safely-0.2.1-py3-none-any.whl.
File metadata
- Download URL: safely-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.9.13 Linux/5.15.0-1019-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e26f4c8143ee6214add737ac26f032ef1ef1dc6f5e079fa363c293824d156ac
|
|
| MD5 |
592f7aa8dc6be99bbdabbe61466a3844
|
|
| BLAKE2b-256 |
c733cc40464b16aa2afe7265dc72dcb6cf554b4e17899b01d948956a6df74201
|