Skip to content

Conversation

AlexWaygood
Copy link
Member

This line is buggy. As a result of the bug, several of the assertions added in python/cpython#105835 don't pass on Python 3.7:

and issubclass(other, (typing.Generic, _ProtocolMeta))

It should be

issubclass(other, typing.Generic) or isinstance(other, _ProtocolMeta)

But we can also rewrite the condition more elegantly using the new is_protocol function, so that's what I've done in this PR.

@JelleZijlstra JelleZijlstra merged commit af89916 into python:main Jun 16, 2023
@AlexWaygood AlexWaygood deleted the proto-subclass-bug branch June 16, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants