peps: 4d6c827944c4 (original) (raw)

Mercurial > peps

changeset 4920:4d6c827944c4

Explicitly state that the default implementation is registered for `object` Thanks to Gustavo Carneiro for the suggestion.

Ɓukasz Langa lukasz@langa.pl
date Fri, 31 May 2013 12:31:11 +0200
parents 92816a630302
children 38826efc5fe4
files pep-0443.txt
diffstat 1 files changed, 7 insertions(+), 3 deletions(-)[+] [-] pep-0443.txt 10

line wrap: on

line diff

--- a/pep-0443.txt +++ b/pep-0443.txt @@ -134,13 +134,17 @@ argument:: Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation. +The original function decorated with @singledispatch is registered +for the base object type, which means it is used if no better +implementation is found. + To check which implementation will the generic function choose for a given type, use the dispatch() attribute::

fun.dispatch(float) <function fun_num at 0x104319058>