summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/queues.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-01-22 12:28:51 (GMT)
committerGitHub <noreply@github.com>2022-01-22 12:28:51 (GMT)
commit90e2998db78cd15e45b3c82f6360ac8841e03945 (patch)
tree534efde7eb1062aef3b613150d2d19e247faf827 /Lib/asyncio/queues.py
parentd4a9e34401d519250d3b3744cd10394069f748c1 (diff)
downloadcpython-90e2998db78cd15e45b3c82f6360ac8841e03945.zip
cpython-90e2998db78cd15e45b3c82f6360ac8841e03945.tar.gz
cpython-90e2998db78cd15e45b3c82f6360ac8841e03945.tar.bz2
[3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (#30784)
* 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> (cherry picked from commit ea5b96842e066623a53015d8b2492ed61a5baf96) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> * Fix tests Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Lib/asyncio/queues.py')
-rw-r--r--Lib/asyncio/queues.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/queues.py b/Lib/asyncio/queues.py
index a87ec8b..10dd689 100644
--- a/Lib/asyncio/queues.py
+++ b/Lib/asyncio/queues.py
@@ -2,6 +2,7 @@ __all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty')
import collections
import heapq
+from types import GenericAlias
from . import locks
from . import mixins
@@ -69,8 +70,7 @@ class Queue(mixins._LoopBoundMixin):
def __str__(self):
return f'<{type(self).__name__} {self._format()}>'
- def __class_getitem__(cls, type):
- return cls
+ __class_getitem__ = classmethod(GenericAlias)
def _format(self):
result = f'maxsize={self._maxsize!r}'