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
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 callback-factory-0.0.3.tar.gz.
File metadata
- Download URL: callback-factory-0.0.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85a5b7647a8218c551aedc3eb1f89ef1adce44bc07397b426664dd8a72db06fb
|
|
| MD5 |
b2c8004d7581d75ec1ee70a61325724b
|
|
| BLAKE2b-256 |
19417d8c5f2040c914987ed2ff3f52eadb265cd9d60957cec7b9edb097247d5b
|
File details
Details for the file callback_factory-0.0.3-py3-none-any.whl.
File metadata
- Download URL: callback_factory-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1acd0d5235ff6b5050f6e5abe14b9094293a7366fa5c9d7fa1fa0d1d0d9f775b
|
|
| MD5 |
e0465ada72057b907f4fee2d53d67057
|
|
| BLAKE2b-256 |
f3751b2a6af668f7eecaaf984a1438a8839a5eac26f6761c7e8863f566699c03
|