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
Update Lib/typing.py
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
randolf-scholz and AlexWaygood authored Nov 23, 2023
commit 36706a649168e733b32975ec0641204b89f44378
2 changes: 1 addition & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ class _TypingEllipsis:
def _get_local_members(namespace):
"""Collect the specified attributes from a classes' namespace."""
annotations = namespace.get("__annotations__", {})
attrs = (set(namespace) | set(annotations)) - EXCLUDED_MEMBERS
attrs = (namespace.keys() | annotations.keys()) - EXCLUDED_MEMBERS
# exclude special "_abc_" attributes
return {attr for attr in attrs if not attr.startswith('_abc_')}

Expand Down
0