some decorators
Project description
This repo hosts 3 useful decorators that might come handy while prototyping namely -
@debug
@timer
@safe_run
debug
and timer
are taken from https://realpython.com/primer-on-python-decorators/.
@debug prints the function name with the arguments passed and the return value at the end each time a function is called.
@timer as the name suggests times the function to be executed and in the end prints the total time taken by that function.
@safe_run
is in brief tries to run the function and prints the error in case the function throws some error. @safe_run
takes dictionary of parameters also to let the user customize the behavior of it.
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 Distributions
Hashes for decos-0.0.12.post6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 429a803f944b0137e5efc606319c3c9f4482ba50b3bc285975ba7a734643c200 |
|
MD5 | 432eeab6a55743be2d95b0c96fdf6575 |
|
BLAKE2b-256 | 2e1236294a932e899d71f8581097ce49389ea878cf7211e2fef3f9cfeedde350 |