mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (GH-30785)
Automerge-Triggered-By: GH:asvetlov
This commit is contained in:
parent
3c4a3745b9
commit
6ed874f8c5
8 changed files with 29 additions and 24 deletions
|
@ -17,6 +17,7 @@ import itertools
|
|||
import types
|
||||
import warnings
|
||||
import weakref
|
||||
from types import GenericAlias
|
||||
|
||||
from . import base_tasks
|
||||
from . import coroutines
|
||||
|
@ -147,8 +148,7 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
|
|||
self._loop.call_exception_handler(context)
|
||||
super().__del__()
|
||||
|
||||
def __class_getitem__(cls, type):
|
||||
return cls
|
||||
__class_getitem__ = classmethod(GenericAlias)
|
||||
|
||||
def _repr_info(self):
|
||||
return base_tasks._task_repr_info(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue