Skip to main content

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


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.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

callback_factory-0.0.3-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page