Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commented Dec 25, 2021

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

https://bugs.python.org/issue46032

…ration time (pythonGH-30050) (pythonGH-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 078abb6) (cherry picked from commit 03c7449) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@miss-islington
Copy link
ContributorAuthor

@serhiy-storchaka: Status check is done, and it's a success ❌ .

@serhiy-storchakaserhiy-storchaka changed the title [3.9] [3.10] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254)[3.9] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254)Dec 26, 2021
@serhiy-storchakaserhiy-storchaka merged commit 25a12aa into python:3.9Dec 26, 2021
@miss-islingtonmiss-islington deleted the backport-03c7449-3.9 branch December 26, 2021 12:23
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bugAn unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@miss-islington@serhiy-storchaka@the-knights-who-say-ni@bedevere-bot