Skip to content
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

bpo-27984: explictly check type of singledispatch.dispatch() argument #6114

Closed
wants to merge 1 commit into from

Conversation

zhangyangyu
Copy link
Member

@zhangyangyu zhangyangyu commented Mar 14, 2018

@zhangyangyu
Copy link
Member Author

backport to 3.6: #6115

@ambv
Copy link
Contributor

ambv commented Mar 14, 2018

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.

We should not slow down calling of all generic functions on the basis that somebody might pass a non-type straight to dispatch().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants