[3.9] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254) by miss-islington · Pull Request #30255 · python/cpython (original) (raw)
The registry() method of functools.singledispatch() functions checks now
the first argument or the first parameter annotation and raises a TypeError if it is
not supported. Previously unsupported "types" were ignored (e.g. typing.List[int])
or caused an error at calling time (e.g. list[int]).
(cherry picked from commit 078abb6)
(cherry picked from commit 03c7449)
Co-authored-by: Serhiy Storchaka storchaka@gmail.com