[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2021-11-09 Thread Alex Waygood
Alex Waygood added the comment: Reproduced on 3.11. -- nosy: +AlexWaygood, lukasz.langa, rhettinger versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 ___ Python tracker

[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-04 Thread Filipe Laíns
Filipe Laíns added the comment: Right, forgot about that. We can get the first argument name from inspect.signature and then fetch it from the get_type_hints dictionary, I don't know a better way to do it. -- ___ Python tracker

[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-04 Thread Dutcho
Dutcho added the comment: I'm afraid my "even return" was interpreted in https://github.com/python/cpython/pull/19871 as "only return", while as stated "any annotation" suffices. To rephrase: If the *first* parameter of the registered function isn't annotated, any non-first annotation suffic

[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-02 Thread Filipe Laíns
Change by Filipe Laíns : -- keywords: +patch nosy: +FFY00 nosy_count: 2.0 -> 3.0 pull_requests: +19184 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19871 ___ Python tracker

[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-01 Thread Vismantas
Change by Vismantas : -- nosy: +bim_bam ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-01 Thread Dutcho
New submission from Dutcho : >From Python 3.7, `functools.singledispatch` makes the `register()` attribute >of the generic function infer the type of the first argument automatically for >functions annotated with types. That's great for DRY. However, in 3.7 and 3.8, no check is made that the *