New submission from Kumar Aditya <rahuladitya...@gmail.com>:
In asyncio, the Generic classes return the class itself in __class_getitem__ instead of GenericAlias, because of this they cannot be introspected as GenericAlias objects. Running Debug|x64 interpreter... Python 3.11.0a4+ (main, Jan 22 2022, 10:00:18) [MSC v.1930 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import asyncio >>> asyncio.Future <class '_asyncio.Future'> >>> asyncio.Future[int] <class '_asyncio.Future'> >>> list <class 'list'> >>> list[int] list[int] >>> list[int].__args__ (<class 'int'>,) >>> asyncio.Future[int].__args__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: type object '_asyncio.Future' has no attribute '__args__' ---------- messages: 411231 nosy: asvetlov, kumaraditya303, yselivanov priority: normal severity: normal status: open title: asyncio Generic classes should return GenericAlias in __class_getitem__ type: behavior versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46469> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com