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
_PROTO_ALLOWLIST = {
'collections.abc': [
'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable',
- 'Hashable', 'Sized', 'Container', 'Collection', 'Reversible', 'Buffer',
+ 'AsyncIterator', 'Hashable', 'Sized', 'Container', 'Collection',
+ 'Reversible', 'Buffer',
],
'contextlib': ['AbstractContextManager', 'AbstractAsyncContextManager'],
}