8000 gh-105144: Runtime-checkable protocols: move all 'sanity checks' to `_ProtocolMeta.__subclasscheck__` by AlexWaygood · Pull Request #105152 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-105144: Runtime-checkable protocols: move all 'sanity checks' to _ProtocolMeta.__subclasscheck__ #105152

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

Merged
merged 4 commits into from
May 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
off-by-one error in a comment!
  • Loading branch information
AlexWaygood committed May 31, 2023
commit 3ba9647d31cf08234cfce3cb6357b6e6552a29fb
1 change: 0 additions & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,6 @@ def _proto_hook(other):
if not cls.__dict__.get('_is_protocol', False):
return NotImplemented

# Second, perform the actual structural compatibility check.
for attr in cls.__protocol_attrs__:
for base in other.__mro__:
# Check if the members appears in the class dictionary...
Expand Down
0