[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public

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

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

Closed
wants to merge 1 commit into from

Conversation

Copy link
Member

zhangyangyu commented Mar 14, 2018

Copy link
Member Author

backport to 3.6: #6115

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().

ambv closed this Mar 14, 2018
zhangyangyu deleted the issue27984 branch March 14, 2018 23:34
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.

5 participants