On 23 May 2013 17:00, Walter Dörwald <[email protected]> wrote:

> Should it be possible to register multiple types for the generic function
> with one register() call, i.e. should:
>
>    @fun.register(int, float)
>    def _(arg, verbose=False):
>       ...
>
> be allowed as a synonym for
>
>    @fun.register(int)
>    @fun.register(float)
>    def _(arg, verbose=False):
>

No, because people will misread register(int, float) as meaning first
argument int, second float. The double decorator is explicit as to what is
going on, and isn't too hard to read or write.

Paul
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to