On 23.05.13 00:33, Łukasz Langa wrote:

Hello,
I would like to submit the following PEP for discussion and evaluation.


PEP: 443
Title: Single-dispatch generic functions
[...]
   >>> @fun.register(int)
   ... def _(arg, verbose=False):
   ...     if verbose:
   ...         print("Strength in numbers, eh?", end=" ")
   ...     print(arg)
   ...

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):
      ...

Servus,
   Walter

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
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