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
File details
Details for the file callback-factory-0.0.2.tar.gz
.
File metadata
- Download URL: callback-factory-0.0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4870edc3b26f3abbba7cfaa458dad13e751b7c4a1d26ab133ddfb0b961d1d304 |
|
MD5 | 21d76f40c817c452ac0c103902d19da1 |
|
BLAKE2b-256 | 6d41534710f2afcb8823cd12bef521a52268b758081e154d2e535f483023a846 |
File details
Details for the file callback_factory-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: callback_factory-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 810527c431e01814459eeac28f759c3992ddb47d35671293edca43b5ec2078c0 |
|
MD5 | 7096ed856b082256a3ede4c238223414 |
|
BLAKE2b-256 | 8ccad64d2cc9d9496ceb36c69f24931c15fc2867593284a8e674b4c03a800f3f |