Skip to content

Commit d8fd8c8

Browse files
bpo-42392: [docs] Add deprecated-removed loop labels for asyncio (GH-26357)
* Add deprecated-removed loop labels for all reelvant functions/classes in asyncio
1 parent f6fbdb9 commit d8fd8c8

7 files changed

+153
-0
lines changed

Doc/library/asyncio-queue.rst

+7
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ Queue
105105
Raises :exc:`ValueError` if called more times than there were
106106
items placed in the queue.
107107

108+
.. deprecated-removed:: 3.8 3.10
109+
110+
The ``loop`` parameter. This function has been implicitly getting the
111+
current running loop since 3.7. See
112+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
113+
for more information.
114+
108115

109116
Priority Queue
110117
==============

Doc/library/asyncio-stream.rst

+29
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ and work with streams:
7070

7171
The *ssl_handshake_timeout* parameter.
7272

73+
.. deprecated-removed:: 3.8 3.10
74+
75+
The ``loop`` parameter. This function has been implicitly getting the
76+
current running loop since 3.7. See
77+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
78+
for more information.
79+
80+
7381
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
7482
port=None, *, limit=None, \
7583
family=socket.AF_UNSPEC, \
@@ -100,6 +108,13 @@ and work with streams:
100108

101109
The *ssl_handshake_timeout* and *start_serving* parameters.
102110

111+
.. deprecated-removed:: 3.8 3.10
112+
113+
The ``loop`` parameter. This function has been implicitly getting the
114+
current running loop since 3.7. See
115+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
116+
for more information.
117+
103118

104119
.. rubric:: Unix Sockets
105120

@@ -124,6 +139,13 @@ and work with streams:
124139

125140
The *path* parameter can now be a :term:`path-like object`
126141

142+
.. deprecated-removed:: 3.8 3.10
143+
144+
The ``loop`` parameter. This function has been implicitly getting the
145+
current running loop since 3.7. See
146+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
147+
for more information.
148+
127149

128150
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
129151
*, limit=None, sock=None, backlog=100, ssl=None, \
@@ -145,6 +167,13 @@ and work with streams:
145167

146168
The *path* parameter can now be a :term:`path-like object`.
147169

170+
.. deprecated-removed:: 3.8 3.10
171+
172+
The ``loop`` parameter. This function has been implicitly getting the
173+
current running loop since 3.7. See
174+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
175+
for more information.
176+
148177

149178
StreamReader
150179
============

Doc/library/asyncio-subprocess.rst

+14
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ Creating Subprocesses
7575
See the documentation of :meth:`loop.subprocess_exec` for other
7676
parameters.
7777

78+
.. deprecated-removed:: 3.8 3.10
79+
80+
The ``loop`` parameter. This function has been implicitly getting the
81+
current running loop since 3.7. See
82+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
83+
for more information.
84+
7885

7986
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
8087
stdout=None, stderr=None, limit=None, **kwds)
@@ -99,6 +106,13 @@ Creating Subprocesses
99106
escape whitespace and special shell characters in strings that are going
100107
to be used to construct shell commands.
101108

109+
.. deprecated-removed:: 3.8 3.10
110+
111+
The ``loop`` parameter. This function has been implicitly getting the
112+
current running loop since 3.7. See
113+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
114+
for more information.
115+
102116
.. note::
103117

104118
Subprocesses are available for Windows if a :class:`ProactorEventLoop` is

Doc/library/asyncio-sync.rst

+31
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ Lock
6363
finally:
6464
lock.release()
6565

66+
.. deprecated-removed:: 3.8 3.10
67+
The ``loop`` parameter. This class has been implicitly getting the
68+
current running loop since 3.7. See
69+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
70+
for more information.
71+
6672
.. coroutinemethod:: acquire()
6773

6874
Acquire the lock.
@@ -105,6 +111,12 @@ Event
105111
:meth:`clear` method. The :meth:`~Event.wait` method blocks until the
106112
flag is set to *true*. The flag is set to *false* initially.
107113

114+
.. deprecated-removed:: 3.8 3.10
115+
The ``loop`` parameter. This class has been implicitly getting the
116+
current running loop since 3.7. See
117+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
118+
for more information.
119+
108120
.. _asyncio_example_sync_event:
109121

110122
Example::
@@ -177,6 +189,12 @@ Condition
177189
``None``. In the latter case a new Lock object is created
178190
automatically.
179191

192+
.. deprecated-removed:: 3.8 3.10
193+
The ``loop`` parameter. This class has been implicitly getting the
194+
current running loop since 3.7. See
195+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
196+
for more information.
197+
180198
The preferred way to use a Condition is an :keyword:`async with`
181199
statement::
182200

@@ -273,6 +291,12 @@ Semaphore
273291
internal counter (``1`` by default). If the given value is
274292
less than ``0`` a :exc:`ValueError` is raised.
275293

294+
.. deprecated-removed:: 3.8 3.10
295+
The ``loop`` parameter. This class has been implicitly getting the
296+
current running loop since 3.7. See
297+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
298+
for more information.
299+
276300
The preferred way to use a Semaphore is an :keyword:`async with`
277301
statement::
278302

@@ -325,6 +349,13 @@ BoundedSemaphore
325349
a :exc:`ValueError` in :meth:`~Semaphore.release` if it
326350
increases the internal counter above the initial *value*.
327351

352+
.. deprecated-removed:: 3.8 3.10
353+
354+
The ``loop`` parameter. This class has been implicitly getting the
355+
current running loop since 3.7. See
356+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
357+
for more information.
358+
328359
---------
329360

330361

Doc/library/asyncio-task.rst

+69
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ Sleeping
297297
tasks to run. This can be used by long-running functions to avoid
298298
blocking the event loop for the full duration of the function call.
299299

300+
.. deprecated-removed:: 3.8 3.10
301+
The ``loop`` parameter. This function has been implicitly getting the
302+
current running loop since 3.7. See
303+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
304+
for more information.
305+
300306
.. _asyncio_example_sleep:
301307

302308
Example of coroutine displaying the current date every second
@@ -317,6 +323,14 @@ Sleeping
317323
asyncio.run(display_date())
318324

319325

326+
.. deprecated-removed:: 3.8 3.10
327+
328+
The ``loop`` parameter. This function has been implicitly getting the
329+
current running loop since 3.7. See
330+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
331+
for more information.
332+
333+
320334
Running Tasks Concurrently
321335
==========================
322336

@@ -349,6 +363,12 @@ Running Tasks Concurrently
349363
cancellation of one submitted Task/Future to cause other
350364
Tasks/Futures to be cancelled.
351365

366+
.. deprecated-removed:: 3.8 3.10
367+
The ``loop`` parameter. This function has been implicitly getting the
368+
current running loop since 3.7. See
369+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
370+
for more information.
371+
352372
.. _asyncio_example_gather:
353373

354374
Example::
@@ -400,6 +420,12 @@ Running Tasks Concurrently
400420
If the *gather* itself is cancelled, the cancellation is
401421
propagated regardless of *return_exceptions*.
402422

423+
.. deprecated-removed:: 3.8 3.10
424+
The ``loop`` parameter. This function has been implicitly getting the
425+
current running loop since 3.7. See
426+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
427+
for more information.
428+
403429
.. deprecated:: 3.10
404430
Deprecation warning is emitted if no positional arguments are provided
405431
or not all positional arguments are Future-like objects
@@ -442,6 +468,12 @@ Shielding From Cancellation
442468
except CancelledError:
443469
res = None
444470

471+
.. deprecated-removed:: 3.8 3.10
472+
The ``loop`` parameter. This function has been implicitly getting the
473+
current running loop since 3.7. See
474+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
475+
for more information.
476+
445477
.. deprecated:: 3.10
446478
Deprecation warning is emitted if *aw* is not Future-like object
447479
and there is no running event loop.
@@ -473,6 +505,12 @@ Timeouts
473505

474506
If the wait is cancelled, the future *aw* is also cancelled.
475507

508+
.. deprecated-removed:: 3.8 3.10
509+
The ``loop`` parameter. This function has been implicitly getting the
510+
current running loop since 3.7. See
511+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
512+
for more information.
513+
476514
.. _asyncio_example_waitfor:
477515

478516
Example::
@@ -500,6 +538,12 @@ Timeouts
500538
for *aw* to be cancelled. Previously, it raised
501539
:exc:`asyncio.TimeoutError` immediately.
502540

541+
.. deprecated-removed:: 3.8 3.10
542+
The ``loop`` parameter. This function has been implicitly getting the
543+
current running loop since 3.7. See
544+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
545+
for more information.
546+
503547

504548
Waiting Primitives
505549
==================
@@ -556,6 +600,12 @@ Waiting Primitives
556600
``wait()`` directly is deprecated as it leads to
557601
:ref:`confusing behavior <asyncio_example_wait_coroutine>`.
558602

603+
.. deprecated-removed:: 3.8 3.10
604+
The ``loop`` parameter. This function has been implicitly getting the
605+
current running loop since 3.7. See
606+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
607+
for more information.
608+
559609
.. _asyncio_example_wait_coroutine:
560610
.. note::
561611

@@ -583,6 +633,13 @@ Waiting Primitives
583633
if task in done:
584634
# Everything will work as expected now.
585635

636+
.. deprecated-removed:: 3.8 3.10
637+
638+
The ``loop`` parameter. This function has been implicitly getting the
639+
current running loop since 3.7. See
640+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
641+
for more information.
642+
586643
.. deprecated-removed:: 3.8 3.11
587644

588645
Passing coroutine objects to ``wait()`` directly is
@@ -599,12 +656,24 @@ Waiting Primitives
599656
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
600657
all Futures are done.
601658

659+
.. deprecated-removed:: 3.8 3.10
660+
The ``loop`` parameter. This function has been implicitly getting the
661+
current running loop since 3.7. See
662+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
663+
for more information.
664+
602665
Example::
603666

604667
for coro in as_completed(aws):
605668
earliest_result = await coro
606669
# ...
607670

671+
.. deprecated-removed:: 3.8 3.10
672+
The ``loop`` parameter. This function has been implicitly getting the
673+
current running loop since 3.7. See
674+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
675+
for more information.
676+
608677
.. deprecated:: 3.10
609678
Deprecation warning is emitted if not all awaitable objects in the *aws*
610679
iterable are Future-like objects and there is no running event loop.

Doc/whatsnew/3.10.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,7 @@ Deprecated
15781578
* ``cgi.log()`` is deprecated and slated for removal in Python 3.12.
15791579
(Contributed by Inada Naoki in :issue:`41139`.)
15801580
1581+
.. _whatsnew310-removed:
15811582
15821583
Removed
15831584
=======
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Document the deprecation and removal of the ``loop`` parameter for many
2+
functions and classes in :mod:`asyncio`.

0 commit comments

Comments
 (0)