diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-01-22 11:28:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 11:28:53 (GMT) |
commit | ea5b96842e066623a53015d8b2492ed61a5baf96 (patch) | |
tree | 79b3a3f4d23698995899a6b8d3ce067856c30f58 /Lib/asyncio/tasks.py | |
parent | ab8fe22e5e4e282da8ea6f4e77f4c0a6616ec9c2 (diff) | |
download | cpython-ea5b96842e066623a53015d8b2492ed61a5baf96.zip cpython-ea5b96842e066623a53015d8b2492ed61a5baf96.tar.gz cpython-ea5b96842e066623a53015d8b2492ed61a5baf96.tar.bz2 |
bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)
* bpo-46469: Make asyncio generic classes return GenericAlias
* 📜🤖 Added by blurb_it.
* Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r-- | Lib/asyncio/tasks.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 53eef84..445a9f5 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -17,6 +17,7 @@ import itertools import types import warnings import weakref +from types import GenericAlias from . import base_tasks from . import coroutines @@ -123,8 +124,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) |