[Python-ideas] PEP 443 - multiple types registered

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


> The decorator doesn't change the function so there is no decorated
version of the function to return. It just registers it in a dispatch table
that the generic function uses. I think this is a fairly common pattern.
For example, see flask.route.

I've wrote all kind of decorators, including some that just store some
information and returns the original function. This is not very important...

The  fact is that I still feel that register could allow a tuple of types
without compromising the API. Maybe a "register_many" could be added then...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130605/808461c5/attachment.html>


More information about the Python-ideas mailing list