8000 bpo-36373: Deprecate explicit loop parameter in all public asyncio AP… · python/cpython@55daf1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 55daf1a

Browse files
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)
This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. fourth step: queue.py https://bugs.python.org/issue36373 (cherry picked from commit 9008be3) Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
1 parent bb8fc8b commit 55daf1a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Doc/library/asyncio-queue.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Queue
3232
the queue is always known and can be returned by calling the
3333
:meth:`qsize` method.
3434

35+
.. deprecated-removed:: 3.8 3.10
36+
The *loop* parameter.
37+
38+
3539
This class is :ref:`not thread safe <asyncio-multithreading>`.
3640

3741
.. attribute:: maxsize

Lib/asyncio/queues.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import collections
44
import heapq
5+
import warnings
56

67
from . import events
78
from . import locks
@@ -34,6 +35,9 @@ def __init__(self, maxsize=0, *, loop=None):
3435
self._loop = events.get_event_loop()
3536
else:
3637
self._loop = loop
38+
warnings.warn("The loop argument is deprecated since Python 3.8, "
39+
"and scheduled for removal in Python 3.10.",
40+
DeprecationWarning, stacklevel=2)
3741
self._maxsize = maxsize
3842

3943
# Futures.

0 commit comments

Comments
 (0)
0