Message411231
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__' |
|
Date |
User |
Action |
Args |
2022-01-22 04:41:15 | kumaraditya | set | recipients:
+ kumaraditya, asvetlov, yselivanov |
2022-01-22 04:41:15 | kumaraditya | set | messageid: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> |
2022-01-22 04:41:15 | kumaraditya | link | issue46469 messages |
2022-01-22 04:41:15 | kumaraditya | create | |
|