plum-dispatch
Multiple dispatch in Python
Decision gist · record as of 2026-08-14
Yes. Plum is actively maintained, has no security vulnerabilities, uses a permissive MIT license, and installs with low friction. It is appropriate for projects that need clean, type-driven polymorphism—particularly scientific computing, machine learning, and backend-agnostic libraries. The Python 3.10 or higher requirement is a hard constraint; if you need older Python support, this is not an option.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or higher.
- Dispatch decisions are based only on positional arguments; arguments without defaults must always be passed positionally, not as keyword arguments.
- Low friction install with three runtime dependencies (beartype, rich, typing-extensions).
License · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes no significant restrictions on use, modification, or distribution in commercial or private projects.
last release 2026-04-28 (108 days) · last repo commit 2026-08-06 · 653 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,815,888 downloads/mo, #3,523 on PyPI
Alternatives
Verify before relying
pip install plum-dispatch
from plum import dispatch
@dispatch
def f(x: str):
return "This is a string!"
@dispatch
def f(x: int):
return "This is an integer!"
f("1") # 'This is a string!'
f(1) # 'This is an integer!'- Performance characteristics compared to other multiple dispatch implementations in typical workloads
- Whether keyword-only dispatch or mixed positional-keyword patterns are planned for future releases
What it is and what it does
Plum brings type annotations to life by implementing multiple dispatch—a pattern where a single function name can have multiple implementations, each handling different argument types. When you call the function, Plum examines the types of the positional arguments and selects the most specific matching implementation. This is inspired by Julia's dispatch model and differs from Python's built-in single dispatch by supporting multiple arguments and type hierarchies.
The package is powered by beartype and depends on rich and typing-extensions. It works with type hierarchies (e.g., Number, Real, Rational) and automatically selects the best-matching implementation when arguments span multiple types. A key constraint: dispatch decisions are based only on positional arguments, not keyword arguments, so arguments without defaults must always be passed positionally.
Use it for
- Implement backend-agnostic libraries that handle multiple array types with specialized code paths for each
- Build scientific computing libraries where operations differ based on numeric types (integers, reals, complex numbers)
- Create extensible data processing pipelines where different data types trigger different processing strategies
- Design machine learning frameworks that need to dispatch to optimized implementations based on input types
- Develop coordinate or geometry systems where operations vary by coordinate system or dimension type
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Plum is actively maintained, has no security vulnerabilities, uses a permissive MIT license, and installs with low friction. It is appropriate for projects that need clean, type-driven polymorphism—particularly scientific computing, machine learning, and backend-agnostic libraries. The Python 3.10 or higher requirement is a hard constraint; if you need older Python support, this is not an option.
Install
plum-dispatch on PyPI
Before you install
Low friction install with three runtime dependencies (beartype, rich, typing-extensions). The package is actively maintained with a recent release and no known vulnerabilities, though it requires Python 3.10 or higher.
Requires Python 3.10 or higher. Dispatch decisions are based only on positional arguments; arguments without defaults must always be passed positionally, not as keyword arguments.
License in practice
MIT license is permissive and imposes no significant restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install plum-dispatch
from plum import dispatch
@dispatch
def f(x: str):
return "This is a string!"
@dispatch
def f(x: int):
return "This is an integer!"
f("1") # 'This is a string!'
f(1) # 'This is an integer!'
Verify before relying
- Performance characteristics compared to other multiple dispatch implementations in typical workloads
- Whether keyword-only dispatch or mixed positional-keyword patterns are planned for future releases
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesbeartyperichtyping-extensions |
| Maintenance | Actively maintained 108 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,815,888 / month, #3,523 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Typing :: Typed |
Evidence: plum_dispatch-2.9.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 › “multiple dispatch python”
- plum-dispatchPlum implements multiple dispatch in Python, allowing you to define…
- multimethodMultimethod provides a decorator for adding multiple argument…
- ovldOvld provides fast multiple dispatch for Python functions, allowing…
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 overloading · multipledispatch · ovld · classes · pyvers · runtype · multimethod · fasttransform · tree-sitter-julia · plum-py