8000 gh-102433: Add tests for how classes with properties interact with `isinstance()` checks on `typing.runtime_checkable` protocols by AlexWaygood · Pull Request #102449 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-102433: Add tests for how classes with properties interact with isinstance() checks on typing.runtime_checkable protocols #102449

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 6 commits into from
Mar 11, 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
Next Next commit
Update Lib/test/test_typing.py
  • Loading branch information
AlexWaygood authored Mar 10, 2023
commit b4ed9770153c6612975a26f59e940d6da27dc80c
5 changes: 3 additions & 2 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2555,8 +2555,9 @@ class E: ...
class F(C): ...
class G(D): ...

self.assertEqual(C().attr, 42)
self.assertEqual(D().attr, 42)
for klass in C, D, F, G:
with self.subTest(klass=klass.__name__):
self.assertEqual(klass().attr, 42)

T = TypeVar('T')

Expand Down
0