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 hashes)
Built Distribution
safely-0.2.1-py3-none-any.whl
(3.8 kB
view hashes)