8000 gh-112319: Allow special protocol members by randolf-scholz · Pull Request #112340 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112319: Allow special protocol members #112340

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
reverted typeerror context
  • Loading branch information
randolf-scholz committed Nov 23, 2023
commit d9c4c3c8c3214f3ade1b0c143fa359e5996a1374
3 changes: 1 addition & 2 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1885,8 +1885,7 @@ def __subclasscheck__(cls, other):
and cls.__dict__.get("__subclasshook__") is _proto_hook
):
raise TypeError(
f"Protocols with non-method members don't support issubclass()."
f" Non-method members: {cls.__protocol_attrs__}."
"Protocols with non-method members don't support issubclass()"
)
if not getattr(cls, '_is_runtime_protocol', False):
raise TypeError(
Expand Down
0