diff --git a/src/test_typing.py b/src/test_typing.py index 935bd9412..9ab42a3f6 100644 --- a/src/test_typing.py +++ b/src/test_typing.py @@ -1844,6 +1844,7 @@ def athrow(self, typ, val=None, tb=None): self.assertIsInstance(instance, collections.AsyncGenerator) self.assertIsInstance(instance, collections.AsyncIterable) self.assertNotIsInstance(type(g), G) + self.assertNotIsInstance(g, G) def test_subclassing_subclasshook(self): diff --git a/src/typing.py b/src/typing.py index e96e4b800..00ef44010 100644 --- a/src/typing.py +++ b/src/typing.py @@ -1902,10 +1902,8 @@ def __new__(cls, *args, **kwds): return _generic_new(_G_base, cls, *args, **kwds) if hasattr(collections_abc, 'AsyncGenerator'): - _AG_base = collections_abc.AsyncGenerator - class AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra], - extra=_AG_base): + extra=collections_abc.AsyncGenerator): __slots__ = () __all__.append('AsyncGenerator')