bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)

This commit is contained in:
Andrew Svetlov 2019-09-12 15:40:40 +03:00 committed by GitHub
parent 3ab61473ba
commit a488879cba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 178 additions and 101 deletions

View file

@ -334,6 +334,9 @@ Running Tasks Concurrently
cancellation of one submitted Task/Future to cause other
Tasks/Futures to be cancelled.
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
.. _asyncio_example_gather:
Example::
@ -411,6 +414,9 @@ Shielding From Cancellation
except CancelledError:
res = None
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
Timeouts
========
@ -478,22 +484,12 @@ Waiting Primitives
set concurrently and block until the condition specified
by *return_when*.
.. deprecated:: 3.8
If any awaitable in *aws* is a coroutine, it is automatically
scheduled as a Task. Passing coroutines objects to
``wait()`` directly is deprecated as it leads to
:ref:`confusing behavior <asyncio_example_wait_coroutine>`.
Returns two sets of Tasks/Futures: ``(done, pending)``.
Usage::
done, pending = await asyncio.wait(aws)
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
*timeout* (a float or int), if specified, can be used to control
the maximum number of seconds to wait before returning.
@ -525,6 +521,17 @@ Waiting Primitives
Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the
futures when a timeout occurs.
.. deprecated:: 3.8
If any awaitable in *aws* is a coroutine, it is automatically
scheduled as a Task. Passing coroutines objects to
``wait()`` directly is deprecated as it leads to
:ref:`confusing behavior <asyncio_example_wait_coroutine>`.
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
.. _asyncio_example_wait_coroutine:
.. note::
@ -568,6 +575,9 @@ Waiting Primitives
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
all Futures are done.
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
Example::
for f in as_completed(aws):
@ -694,6 +704,9 @@ Task Object
.. versionchanged:: 3.8
Added the ``name`` parameter.
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
.. method:: cancel()
Request the Task to be cancelled.