backcall
Specifications for callback functions passed in to an API
What it is and what it does
backcall is a small utility for specifying and enforcing callback function signatures in APIs. When you accept callbacks from users of your library, backcall lets you define a prototype function that describes the expected signature, then automatically adapts incoming callbacks to match it. If a callback has fewer parameters than the prototype, backcall wraps it to discard extras; if it requires more, backcall raises a TypeError at registration time rather than at call time.
The package has no runtime dependencies and installs cleanly. It is designed for library authors who want to evolve their callback APIs without breaking existing user code. However, the project has been abandoned since 2020 with no recent maintenance, so it should only be used in stable, low-change codebases or as a reference for implementing similar validation logic.
Use it for:
- Library authors defining stable callback APIs that may evolve over time while maintaining backward compatibility
- Validating event handler signatures before registering them in event systems or plugin frameworks
- Adapting third-party callbacks to match your API's expected parameter list without manual wrapping
- Catching callback signature mismatches early at registration time rather than at runtime
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
backcall lets you define and validate callback function signatures, automatically adapting callbacks that have fewer parameters than expected and rejecting those that require more.
Yes, if you are maintaining a library with a stable callback API and want lightweight signature validation without dependencies. No, if you need active maintenance or are starting a new project—the package is abandoned and there are no recent updates. Consider it for mature, low-change codebases only.
Install
backcall on PyPI
pip
pip install backcalluv
uv add backcallpoetry
poetry add backcallInstalling backcall
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2020-06-09 and no commits since then—so it will not receive bug fixes or maintenance.
License in practice
Licensed under BSD (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations.
Quickstart
from backcall import callback_prototype
@callback_prototype
def handle_ping(sender, delay=None):
pass
callback = handle_ping.adapt(your_callback_function)
Verify before relying
- Whether the package works correctly with modern Python versions (classifiers list Python 2.7 and Python 3, but no specific version bounds are declared)
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,257 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 14,815,737/month — #1,216 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: backcall-0.2.0-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
strict-kwargsA standalone CLI linter that enforces keyword…
permissive · top 15,000 on PyPI
retry2Provides a decorator and function wrapper to…
permissive · top 5,000 on PyPI
reretryA decorator and function wrapper for retrying…
permissive · top 15,000 on PyPI
pydantic-function-modelsWraps Python functions to validate their…
permissive · top 15,000 on PyPI
overloadingProvides function and method overloading based…
permissive · top 15,000 on PyPI
decopatchDecopatch simplifies writing decorators in…
permissive · top 5,000 on PyPI
multipledispatchEnables functions to dispatch on the types of…
permissive · top 5,000 on PyPI
makefunDynamically creates Python functions at runtime…
permissive · top 5,000 on PyPI
sigtoolsSigtools provides utilities to inspect and…
permissive · top 5,000 on PyPI
mypy-strict-kwargsA mypy plugin that enforces…
permissive · top 15,000 on PyPI