bpo-46032: Check types in singledispatch's register() at declaration time by serhiy-storchaka · Pull Request #30050 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation8 Commits3 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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]).
https://bugs.python.org/issue46032
…time
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]).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖
Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.10
due to a conflict.
Please backport using cherry_picker on command line.cherry_picker 078abb676cf759b1e960f78390b6e80f256f0255 3.10
Sorry @serhiy-storchaka, I had trouble checking out the 3.9
backport branch.
Please backport using cherry_picker on command line.cherry_picker 078abb676cf759b1e960f78390b6e80f256f0255 3.9
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request
…time (pythonGH-30050)
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)
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
…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
serhiy-storchaka added a commit that referenced this pull request
…ration 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 078abb6)
serhiy-storchaka added a commit that referenced this pull request
…ation time (GH-30050) (GH-30254) (GH-30255)
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
Labels
An unexpected behavior, bug, or error