[Python-Dev] PEP 443 - Single-dispatch generic functions (including ABC support) (original) (raw)

Steven D'Aprano steve at pearwood.info
Sun May 26 04:22:16 CEST 2013


On 26/05/13 09:07, PJ Eby wrote:

""" Transforms a function into a single-dispatch generic function. A **generic function** is composed of multiple functions implementing the same operation for different types. Which implementation should be used during a call is determined by the dispatch algorithm. When the implementation is chosen based on the type of a single argument, this is known as single dispatch.

Adding an implementation to a generic function is achieved by using the :func:register attribute of the generic function. The :func:register attribute is a decorator, taking a type paramater

Typo: /s/paramater/parameter/

and decorating a function implementing the operation for that type."""

Otherwise, +1 on the doc changes suggested.

Thanks PJ and Ɓukasz for seeing this one through.

-- Steven



More information about the Python-Dev mailing list