8000 gh-113320: Reduce the number of dangerous `getattr()` calls when constructing protocol classes by AlexWaygood · Pull Request #113401 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-113320: Reduce the number of dangerous getattr() calls when constructing protocol classes #113401

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
Jan 5, 2024
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
Next Next commit
Better comment
  • Loading branch information
AlexWaygood authored Dec 23, 2023
commit 2d8d40ac6cc7daad5136cd15cb63f12346864f6b
4 changes: 3 additions & 1 deletion Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4136,7 +4136,9 @@ class Commentable(Protocol):
evil = classproperty()

# recognised as a protocol attr,
# but not actually accessed for non-runtime protocols
# but not actually accessed by the protocol metaclass
# (which would raise RuntimeError) for non-runtime protocols.
# See gh-113320
self.assertEqual(get_protocol_members(Commentable), {"evil"})

def test_runtime_protocol_interaction_with_evil_classproperty(self):
Expand Down
0