This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kumaraditya
Recipients asvetlov, kumaraditya, yselivanov
Date 2022-01-22.04:41:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org>
In-reply-to
Content
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__'
History
Date User Action Args
2022-01-22 04:41:15kumaradityasetrecipients: + kumaraditya, asvetlov, yselivanov
2022-01-22 04:41:15kumaradityasetmessageid: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org>
2022-01-22 04:41:15kumaradityalinkissue46469 messages
2022-01-22 04:41:15kumaradityacreate