$npx skillfedfor your agent

singledispatch

Backport functools.singledispatch to older Pythons.

With conditionsPyPI Software DevelopmentReleased May 20252.0M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — singledispatch-4.1.2-py3-none-any.whl
v4.1.2 · released 2025-05-14 · Python >=3.9

Yes, if you need single-dispatch functionality on Python versions before 3.4 or want the latest backport enhancements. No, if you're on Python 3.4+ and can use functools.singledispatch directly from the standard library. The package is stable, well-maintained, has no known vulnerabilities, and carries no license friction.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low install friction; pure Python wheel with no runtime dependencies.
  • Actively maintained by a CPython core team member with recent commits as of 2026-04-13.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal restrictions.

last release 2025-05-14 (457 days) · last repo commit 2026-04-13 · 5 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,001,134 downloads/mo, #3,372 on PyPI

Verify before relying

pip install singledispatch

from singledispatch import singledispatch

@singledispatch
def process(arg):
    print(f"Default: {arg}")

@process.register(int)
def _(arg):
    print(f"Integer: {arg}")

process(arg)
Same gist for agents: .md · .json

What it is and what it does

singledispatch is a backport of Python's functools.singledispatch decorator, which implements single-dispatch generic functions—a lightweight form of function overloading based on the type of the first argument. When you decorate a function with @singledispatch, you can register specialized implementations for specific types using the .register() method; at runtime, the dispatcher automatically calls the appropriate implementation based on the argument's type, falling back to the base implementation for unregistered types.

This is useful when you want to write cleaner, more maintainable code that handles multiple types without nested if-elif chains or isinstance checks scattered throughout. The backport allows you to use this functionality consistently across Python versions, and it also includes singledispatchmethod for class methods. Since the standard library version is built-in to Python 3.4+, this package is most valuable for codebases that need to support older Python versions or for projects that want to stay synchronized with the latest backport enhancements.

Use it for

  • Implement type-specific behavior in a library without explicit type checking or if-elif chains.
  • Create a plugin system where different types are handled by different registered handlers.
  • Build serializers or formatters that need different logic for different types.
  • Simplify mathematical or data-processing functions that operate on multiple numeric types.
  • Define class methods that dispatch on argument type in object-oriented designs.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need single-dispatch functionality on Python versions before 3.4 or want the latest backport enhancements.

No, if you're on Python 3.4+ and can use functools.singledispatch directly from the standard library. The package is stable, well-maintained, has no known vulnerabilities, and carries no license friction.

Install

singledispatch on PyPI

Before you install

Low install friction; pure Python wheel with no runtime dependencies. Actively maintained by a CPython core team member with recent commits as of 2026-04-13.

Requires Python 3.9 or later.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal restrictions.

Quickstart

pip install singledispatch

from singledispatch import singledispatch

@singledispatch
def process(arg):
    print(f"Default: {arg}")

@process.register(int)
def _(arg):
    print(f"Integer: {arg}")

process(arg)

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 457 days since the last release
Last repo commit
First released
Downloads2,001,134 / month, #3,372 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Evidence: singledispatch-4.1.2-py3-none-any.whl

Tags

Capabilities
single dispatch decoratorgeneric functions by typefunctools singledispatch backportmethod overloading pythontype-based function dispatch
Topics
generic-functionsdecoratorbackport
PyPI keywords
singledispatchgenericfunctionssingledispatchgenericfunctionsdecoratorbackport

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 › “single dispatch decorator”

  • singledispatchProvides single-dispatch generic functions—a decorator-based…
  • methoddispatchAdds single-dispatch method support to Python classes, allowing…
  • simplegenericProvides a lightweight decorator-based system for defining…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

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.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

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.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

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.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

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.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

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.

permissive licensepure Python
323.3Mdownloads / mo

See also methoddispatch · multipledispatch · simplegeneric · multimethod · pyvers · ovld · backports.functools-lru-cache · functools32 · classes · pyeventsystem