[Python-Dev] PEP 443 - Single-dispatch generic functions (original) (raw)

Walter Dörwald walter at livinglogic.de
Thu May 23 18:00:09 CEST 2013


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



More information about the Python-Dev mailing list