A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-May/126483.html below:

[Python-Dev] PEP 443 - Single-dispatch generic functions

[Python-Dev] PEP 443 - Single-dispatch generic functionsWalter 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4