[Python-Dev] PEP 443 - Single-dispatch generic functions

Łukasz Langa lukasz at langa.pl
Thu May 23 22:10:21 CEST 2013

On 23 maj 2013, at 20:13, Éric Araujo <merwok at netwok.org> wrote:

> Does this work if the implementation function is called like the first
> decorated function?

No, the ``register()`` attribute returns the undecorated function which
enables decorator stacking, as well as creating unit tests for each
variant independently.

> Making generic functions work with ABCs sounds like a requirement to me

Yes, I will implement that.

> Question: what happens if two functions (say in two different modules)
> are registered for the same type?

Last one wins. Just like with assigning names in a scope, defining methods
in a class or overriding them in a subclass.

Best regards,
Łukasz Langa

WWW: http://lukasz.langa.pl/
Twitter: @llanga
IRC: ambv on #python-dev

More information about the Python-Dev mailing list