Skip to content

[3.9] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254) #30255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 26, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-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
Contributor Author

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

@serhiy-storchaka serhiy-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-storchaka serhiy-storchaka merged commit 25a12aa into python:3.9 Dec 26, 2021
@miss-islington miss-islington deleted the backport-03c7449-3.9 branch December 26, 2021 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants