[3.10] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254)
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 078abb676cf759b1e960f78390b6e80f256f0255)
S
Serhiy Storchaka committed
03c7449fbc7c57f5e0365f234a0b65c1dde763f2
Parent: a9e0b2b
Committed by GitHub <noreply@github.com>
on 12/25/2021, 2:12:32 PM