A simple Python library for producing parameterized and flexible callbacks that can be overriden during execution
Project description
callback
Callback factory in Python, providing two similar approaches to produce parameterized and flexible callbacks that can be overriden during execution.
Installation
pip install callback-factory
Example
from callback import CallbackFactory
def greet(name, greeting="Hello"):
return f"{greeting}, {name}!"
callback = CallbackFactory(greet, "Alice", greeting="Hi")
print(callback()) # Output: Hi, Alice!
One can find more usage examples in examples.py
at the root folder of this project.
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
callback-factory-0.0.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for callback_factory-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14476be9cd04c4f680d5a5a0c19808a0936168fb644d8b521382be092d5cb34d |
|
MD5 | c49ae4da5be3351925db620fbf594693 |
|
BLAKE2b-256 | f8814348cb13142d9675bc5e0f2175630763734d8de37deb2c9693729fae9d3d |