[Python-ideas] PEP 443 - multiple types registered

João Bernardo jbvsmo at gmail.com
Thu Jun 6 02:05:51 CEST 2013


> fun.register() does return the decorated function. This is why the
example above works. @singledispatch returns a compatible wrapper, which is
analogous to what @lru_cache and countless other decorators do. Is there
something I am missing
> here?
> Thanks for your feedback!

Copied from the PEP text:

    The register() attribute returns the *undecorated *function. This
enables decorator stacking, pickling, as well as creating unit tests for
each variant independently:

It's not big deal, just not common
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130605/b1b4d7db/attachment-0001.html>


More information about the Python-ideas mailing list