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/126495.html below:

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

[Python-Dev] PEP 443 - Single-dispatch generic functions [Python-Dev] PEP 443 - Single-dispatch generic functionsSteven D'Aprano steve at pearwood.info
Fri May 24 00:32:22 CEST 2013
On 24/05/13 01:04, Ethan Furman wrote:
> On 05/23/2013 07:58 AM, Ɓukasz Langa wrote:

>> I feel that the PEP should explicitly allow or disallow for the
>> implementation to accept dispatch on annotations, e.g.:
>>
>> @func.register
>> def _(arg: int):
>>    ...
>>
>> versus
>>
>> @func.register(int)
>> def _(arg):
>>    ...
>
> If the stdlib is still staying out of the annotation business, then it should not be allowed.


Perhaps it is time to relax that ruling? The standard library acts as a guide to best practice in Python, and I think that uptake of annotations has been hurt due to the lack of good examples. Also, anyone with the conceit that their library or module may someday be in the standard library cannot afford to use annotations at all.

So I'm tentatively +1 on allowing the annotation form in addition to the decorator argument form.




-- 
Steven
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