We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
https://bugs.python.org/issue27984
Sorry, something went wrong.
bpo-27984: explictly check type of singledispatch.dispatch() argument
5e954be
backport to 3.6: #6115
As commented on the BPO issue: the problem described in this issue is fixed, by BPO-32227.
The wrapper returned by the @register decorator is calling dispatch() with the first argument's __class__. It can only ever be invalid if somebody deliberately wrote something invalid to the object's __class__. It's extremely unlikely.
@register
dispatch()
__class__
We should not slow down calling of all generic functions on the basis that somebody might pass a non-type straight to dispatch().
ncoghlan Awaiting requested review from ncoghlan
rhettinger Awaiting requested review from rhettinger
Successfully merging this pull request may close these issues.