multipledispatch
Multiple dispatch
Decision gist · record as of 2026-08-14
Yes, if you need multiple dispatch and want a lightweight, dependency-free solution. The library is stable and well-established (since 2014), though dormant—last updated 2023-06-27. It has no known vulnerabilities and is widely used (top 5000 on PyPI). Suitable for production use in projects that benefit from type-based polymorphism without the overhead of heavier frameworks.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installs with no dependencies beyond the standard library.
- Maintenance is dormant—last release was 2023-06-27, over 1144 days ago—but the repository remains active with recent commits and no archived status, suggesting it is stable rather than abandoned.
License · maintenance · safety
BSD (permissive) — Licensed under BSD (permissive), so you can use, modify, and distribute it freely in both open and closed projects with minimal restrictions.
last release 2023-06-27 (1144 days) · last repo commit 2024-12-05 · 847 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,566,231 downloads/mo, #2,072 on PyPI
Alternatives
Verify before relying
pip install multipledispatch
from multipledispatch import dispatch
@dispatch(int, int)
def add(x, y):
return x + y
@dispatch(object, object)
def add(x, y):
return f"{x} + {y}"
print(add(1, 2)) # 3
print(add(1, 'hello')) # 1 + hello- Whether the package works with modern Python versions (requires_python is unspecified in the fact sheet).
- Performance characteristics when handling hundreds of type signatures (documentation notes this becomes troublesome but does not quantify the threshold).
What it is and what it does
multipledispatch is a pure-Python library that implements multiple dispatch—a way to select which version of a function to call based on the types of all its arguments, not just the first one. You decorate different implementations of the same function with @dispatch(type1, type2, ...) to register them, and the library automatically routes calls to the right implementation at runtime.
It handles inheritance, instance methods, union types (e.g., int or float), and abstract base classes. It caches lookups for speed and detects ambiguities at definition time to warn you about conflicts. The library has no external dependencies and is lightweight, making it suitable for codebases that need polymorphic behavior without heavyweight frameworks.
Use it for
- Implement mathematical operations that behave differently for different numeric types (int, float, complex) without nested type checks.
- Build domain-specific APIs where methods dispatch on argument types to provide specialized behavior for different data structures.
- Create generic algorithms that adapt their behavior based on whether inputs are sequences, iterables, or scalar values.
- Simplify code that would otherwise use isinstance() chains or a type-based lookup dictionary.
- Support plugin systems where different handlers register implementations for different argument type combinations.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need multiple dispatch and want a lightweight, dependency-free solution.
The library is stable and well-established (since 2014), though dormant—last updated 2023-06-27. It has no known vulnerabilities and is widely used (top 5000 on PyPI). Suitable for production use in projects that benefit from type-based polymorphism without the overhead of heavier frameworks.
Install
multipledispatch on PyPI
Before you install
Installs with no dependencies beyond the standard library. Maintenance is dormant—last release was 2023-06-27, over 1144 days ago—but the repository remains active with recent commits and no archived status, suggesting it is stable rather than abandoned.
License in practice
Licensed under BSD (permissive), so you can use, modify, and distribute it freely in both open and closed projects with minimal restrictions.
Quickstart
pip install multipledispatch
from multipledispatch import dispatch
@dispatch(int, int)
def add(x, y):
return x + y
@dispatch(object, object)
def add(x, y):
return f"{x} + {y}"
print(add(1, 2)) # 3
print(add(1, 'hello')) # 1 + hello
Verify before relying
- Whether the package works with modern Python versions (requires_python is unspecified in the fact sheet).
- Performance characteristics when handling hundreds of type signatures (documentation notes this becomes troublesome but does not quantify the threshold).
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,144 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,566,231 / month, #2,072 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: multipledispatch-1.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “method resolution by argument types”
- multipledispatchEnables functions to dispatch on the types of multiple arguments,…
- ovldOvld provides fast multiple dispatch for Python functions, allowing…
- overloadingProvides function and method overloading based on runtime argument…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also multimethod · overloading · plum-dispatch · singledispatch · methoddispatch · classes · ovld · pyvers · etuples · logical-unification