[3.13] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702) (#126762)

gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702)
(cherry picked from commit feb3e0b19c)

Co-authored-by: Stephen Morton <github@tungol.org>
This commit is contained in:
Miss Islington (bot) 2024-12-02 15:10:25 +01:00 committed by GitHub
parent d9bbb52c7e
commit a5672bec68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View file

@ -4254,6 +4254,9 @@ class ProtocolTests(BaseTestCase):
class CustomContextManager(typing.ContextManager, Protocol):
pass
class CustomAsyncIterator(typing.AsyncIterator, Protocol):
pass
def test_non_runtime_protocol_isinstance_check(self):
class P(Protocol):
x: int