Backport functools.singledispatch from Python 3.4 to Python 2.6-3.3.


Keywords
single, dispatch, generic, functions, singledispatch, genericfunctions, decorator, backport
License
MIT
Install
pip install singledispatch==3.7.0

Documentation

tests Code style: Black https://img.shields.io/badge/skeleton-2021-informational

PEP 443 proposed to expose a mechanism in the functools standard library module in Python 3.4 that provides a simple form of generic programming known as single-dispatch generic functions.

This library is a backport of this functionality and its evolution.

Refer to the upstream documentation for API guidance. To use the backport, simply use from singledispatch import singledispatch, singledispatchmethod in place of from functools import singledispatch, singledispatchmethod.

Maintenance

This backport is maintained on Github by Jason R. Coombs, one of the members of the core CPython team: