You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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__'
New changeset 90e2998 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (bpo-30784) 90e2998
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: