bpo-42392: Remove deprecated loop parameter from docs (GH-23552)
This commit is contained in:
parent
c642374b3e
commit
86150d39c8
|
@ -23,7 +23,7 @@ See also the `Examples`_ section below.
|
||||||
Queue
|
Queue
|
||||||
=====
|
=====
|
||||||
|
|
||||||
.. class:: Queue(maxsize=0, \*, loop=None)
|
.. class:: Queue(maxsize=0)
|
||||||
|
|
||||||
A first in, first out (FIFO) queue.
|
A first in, first out (FIFO) queue.
|
||||||
|
|
||||||
|
@ -36,9 +36,6 @@ Queue
|
||||||
the queue is always known and can be returned by calling the
|
the queue is always known and can be returned by calling the
|
||||||
:meth:`qsize` method.
|
:meth:`qsize` method.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
|
|
||||||
This class is :ref:`not thread safe <asyncio-multithreading>`.
|
This class is :ref:`not thread safe <asyncio-multithreading>`.
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ and work with streams:
|
||||||
|
|
||||||
|
|
||||||
.. coroutinefunction:: open_connection(host=None, port=None, \*, \
|
.. coroutinefunction:: open_connection(host=None, port=None, \*, \
|
||||||
loop=None, limit=None, ssl=None, family=0, \
|
limit=None, ssl=None, family=0, proto=0, \
|
||||||
proto=0, flags=0, sock=None, local_addr=None, \
|
flags=0, sock=None, local_addr=None, \
|
||||||
server_hostname=None, ssl_handshake_timeout=None)
|
server_hostname=None, ssl_handshake_timeout=None)
|
||||||
|
|
||||||
Establish a network connection and return a pair of
|
Establish a network connection and return a pair of
|
||||||
|
@ -59,9 +59,6 @@ and work with streams:
|
||||||
The returned *reader* and *writer* objects are instances of
|
The returned *reader* and *writer* objects are instances of
|
||||||
:class:`StreamReader` and :class:`StreamWriter` classes.
|
:class:`StreamReader` and :class:`StreamWriter` classes.
|
||||||
|
|
||||||
The *loop* argument is optional and can always be determined
|
|
||||||
automatically when this function is awaited from a coroutine.
|
|
||||||
|
|
||||||
*limit* determines the buffer size limit used by the
|
*limit* determines the buffer size limit used by the
|
||||||
returned :class:`StreamReader` instance. By default the *limit*
|
returned :class:`StreamReader` instance. By default the *limit*
|
||||||
is set to 64 KiB.
|
is set to 64 KiB.
|
||||||
|
@ -74,7 +71,7 @@ and work with streams:
|
||||||
The *ssl_handshake_timeout* parameter.
|
The *ssl_handshake_timeout* parameter.
|
||||||
|
|
||||||
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
|
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
|
||||||
port=None, \*, loop=None, limit=None, \
|
port=None, \*, limit=None, \
|
||||||
family=socket.AF_UNSPEC, \
|
family=socket.AF_UNSPEC, \
|
||||||
flags=socket.AI_PASSIVE, sock=None, \
|
flags=socket.AI_PASSIVE, sock=None, \
|
||||||
backlog=100, ssl=None, reuse_address=None, \
|
backlog=100, ssl=None, reuse_address=None, \
|
||||||
|
@ -92,9 +89,6 @@ and work with streams:
|
||||||
:ref:`coroutine function <coroutine>`; if it is a coroutine function,
|
:ref:`coroutine function <coroutine>`; if it is a coroutine function,
|
||||||
it will be automatically scheduled as a :class:`Task`.
|
it will be automatically scheduled as a :class:`Task`.
|
||||||
|
|
||||||
The *loop* argument is optional and can always be determined
|
|
||||||
automatically when this method is awaited from a coroutine.
|
|
||||||
|
|
||||||
*limit* determines the buffer size limit used by the
|
*limit* determines the buffer size limit used by the
|
||||||
returned :class:`StreamReader` instance. By default the *limit*
|
returned :class:`StreamReader` instance. By default the *limit*
|
||||||
is set to 64 KiB.
|
is set to 64 KiB.
|
||||||
|
@ -109,9 +103,9 @@ and work with streams:
|
||||||
|
|
||||||
.. rubric:: Unix Sockets
|
.. rubric:: Unix Sockets
|
||||||
|
|
||||||
.. coroutinefunction:: open_unix_connection(path=None, \*, loop=None, \
|
.. coroutinefunction:: open_unix_connection(path=None, \*, limit=None, \
|
||||||
limit=None, ssl=None, sock=None, \
|
ssl=None, sock=None, server_hostname=None, \
|
||||||
server_hostname=None, ssl_handshake_timeout=None)
|
ssl_handshake_timeout=None)
|
||||||
|
|
||||||
Establish a Unix socket connection and return a pair of
|
Establish a Unix socket connection and return a pair of
|
||||||
``(reader, writer)``.
|
``(reader, writer)``.
|
||||||
|
@ -132,9 +126,8 @@ and work with streams:
|
||||||
|
|
||||||
|
|
||||||
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
|
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
|
||||||
\*, loop=None, limit=None, sock=None, \
|
\*, limit=None, sock=None, backlog=100, ssl=None, \
|
||||||
backlog=100, ssl=None, ssl_handshake_timeout=None, \
|
ssl_handshake_timeout=None, start_serving=True)
|
||||||
start_serving=True)
|
|
||||||
|
|
||||||
Start a Unix socket server.
|
Start a Unix socket server.
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,7 @@ Creating Subprocesses
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
.. coroutinefunction:: create_subprocess_exec(program, \*args, stdin=None, \
|
.. coroutinefunction:: create_subprocess_exec(program, \*args, stdin=None, \
|
||||||
stdout=None, stderr=None, loop=None, \
|
stdout=None, stderr=None, limit=None, \*\*kwds)
|
||||||
limit=None, \*\*kwds)
|
|
||||||
|
|
||||||
Create a subprocess.
|
Create a subprocess.
|
||||||
|
|
||||||
|
@ -76,13 +75,9 @@ Creating Subprocesses
|
||||||
See the documentation of :meth:`loop.subprocess_exec` for other
|
See the documentation of :meth:`loop.subprocess_exec` for other
|
||||||
parameters.
|
parameters.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
|
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
|
||||||
stdout=None, stderr=None, loop=None, \
|
stdout=None, stderr=None, limit=None, \*\*kwds)
|
||||||
limit=None, \*\*kwds)
|
|
||||||
|
|
||||||
Run the *cmd* shell command.
|
Run the *cmd* shell command.
|
||||||
|
|
||||||
|
@ -104,10 +99,6 @@ Creating Subprocesses
|
||||||
escape whitespace and special shell characters in strings that are going
|
escape whitespace and special shell characters in strings that are going
|
||||||
to be used to construct shell commands.
|
to be used to construct shell commands.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Subprocesses are available for Windows if a :class:`ProactorEventLoop` is
|
Subprocesses are available for Windows if a :class:`ProactorEventLoop` is
|
||||||
|
|
|
@ -36,7 +36,7 @@ asyncio has the following basic synchronization primitives:
|
||||||
Lock
|
Lock
|
||||||
====
|
====
|
||||||
|
|
||||||
.. class:: Lock(\*, loop=None)
|
.. class:: Lock()
|
||||||
|
|
||||||
Implements a mutex lock for asyncio tasks. Not thread-safe.
|
Implements a mutex lock for asyncio tasks. Not thread-safe.
|
||||||
|
|
||||||
|
@ -63,9 +63,6 @@ Lock
|
||||||
finally:
|
finally:
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. coroutinemethod:: acquire()
|
.. coroutinemethod:: acquire()
|
||||||
|
|
||||||
Acquire the lock.
|
Acquire the lock.
|
||||||
|
@ -96,7 +93,7 @@ Lock
|
||||||
Event
|
Event
|
||||||
=====
|
=====
|
||||||
|
|
||||||
.. class:: Event(\*, loop=None)
|
.. class:: Event()
|
||||||
|
|
||||||
An event object. Not thread-safe.
|
An event object. Not thread-safe.
|
||||||
|
|
||||||
|
@ -108,10 +105,6 @@ Event
|
||||||
:meth:`clear` method. The :meth:`wait` method blocks until the
|
:meth:`clear` method. The :meth:`wait` method blocks until the
|
||||||
flag is set to *true*. The flag is set to *false* initially.
|
flag is set to *true*. The flag is set to *false* initially.
|
||||||
|
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. _asyncio_example_sync_event:
|
.. _asyncio_example_sync_event:
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
@ -166,7 +159,7 @@ Event
|
||||||
Condition
|
Condition
|
||||||
=========
|
=========
|
||||||
|
|
||||||
.. class:: Condition(lock=None, \*, loop=None)
|
.. class:: Condition(lock=None)
|
||||||
|
|
||||||
A Condition object. Not thread-safe.
|
A Condition object. Not thread-safe.
|
||||||
|
|
||||||
|
@ -184,10 +177,6 @@ Condition
|
||||||
``None``. In the latter case a new Lock object is created
|
``None``. In the latter case a new Lock object is created
|
||||||
automatically.
|
automatically.
|
||||||
|
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
The preferred way to use a Condition is an :keyword:`async with`
|
The preferred way to use a Condition is an :keyword:`async with`
|
||||||
statement::
|
statement::
|
||||||
|
|
||||||
|
@ -270,7 +259,7 @@ Condition
|
||||||
Semaphore
|
Semaphore
|
||||||
=========
|
=========
|
||||||
|
|
||||||
.. class:: Semaphore(value=1, \*, loop=None)
|
.. class:: Semaphore(value=1)
|
||||||
|
|
||||||
A Semaphore object. Not thread-safe.
|
A Semaphore object. Not thread-safe.
|
||||||
|
|
||||||
|
@ -284,10 +273,6 @@ Semaphore
|
||||||
internal counter (``1`` by default). If the given value is
|
internal counter (``1`` by default). If the given value is
|
||||||
less than ``0`` a :exc:`ValueError` is raised.
|
less than ``0`` a :exc:`ValueError` is raised.
|
||||||
|
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
The preferred way to use a Semaphore is an :keyword:`async with`
|
The preferred way to use a Semaphore is an :keyword:`async with`
|
||||||
statement::
|
statement::
|
||||||
|
|
||||||
|
@ -332,7 +317,7 @@ Semaphore
|
||||||
BoundedSemaphore
|
BoundedSemaphore
|
||||||
================
|
================
|
||||||
|
|
||||||
.. class:: BoundedSemaphore(value=1, \*, loop=None)
|
.. class:: BoundedSemaphore(value=1)
|
||||||
|
|
||||||
A bounded semaphore object. Not thread-safe.
|
A bounded semaphore object. Not thread-safe.
|
||||||
|
|
||||||
|
@ -340,10 +325,6 @@ BoundedSemaphore
|
||||||
a :exc:`ValueError` in :meth:`~Semaphore.release` if it
|
a :exc:`ValueError` in :meth:`~Semaphore.release` if it
|
||||||
increases the internal counter above the initial *value*.
|
increases the internal counter above the initial *value*.
|
||||||
|
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ Creating Tasks
|
||||||
Sleeping
|
Sleeping
|
||||||
========
|
========
|
||||||
|
|
||||||
.. coroutinefunction:: sleep(delay, result=None, \*, loop=None)
|
.. coroutinefunction:: sleep(delay, result=None)
|
||||||
|
|
||||||
Block for *delay* seconds.
|
Block for *delay* seconds.
|
||||||
|
|
||||||
|
@ -293,9 +293,6 @@ Sleeping
|
||||||
``sleep()`` always suspends the current task, allowing other tasks
|
``sleep()`` always suspends the current task, allowing other tasks
|
||||||
to run.
|
to run.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. _asyncio_example_sleep:
|
.. _asyncio_example_sleep:
|
||||||
|
|
||||||
Example of coroutine displaying the current date every second
|
Example of coroutine displaying the current date every second
|
||||||
|
@ -319,7 +316,7 @@ Sleeping
|
||||||
Running Tasks Concurrently
|
Running Tasks Concurrently
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
.. awaitablefunction:: gather(\*aws, loop=None, return_exceptions=False)
|
.. awaitablefunction:: gather(\*aws, return_exceptions=False)
|
||||||
|
|
||||||
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
||||||
sequence *concurrently*.
|
sequence *concurrently*.
|
||||||
|
@ -348,9 +345,6 @@ Running Tasks Concurrently
|
||||||
cancellation of one submitted Task/Future to cause other
|
cancellation of one submitted Task/Future to cause other
|
||||||
Tasks/Futures to be cancelled.
|
Tasks/Futures to be cancelled.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. _asyncio_example_gather:
|
.. _asyncio_example_gather:
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
@ -403,7 +397,7 @@ Running Tasks Concurrently
|
||||||
Shielding From Cancellation
|
Shielding From Cancellation
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
.. awaitablefunction:: shield(aw, \*, loop=None)
|
.. awaitablefunction:: shield(aw)
|
||||||
|
|
||||||
Protect an :ref:`awaitable object <asyncio-awaitables>`
|
Protect an :ref:`awaitable object <asyncio-awaitables>`
|
||||||
from being :meth:`cancelled <Task.cancel>`.
|
from being :meth:`cancelled <Task.cancel>`.
|
||||||
|
@ -436,14 +430,11 @@ Shielding From Cancellation
|
||||||
except CancelledError:
|
except CancelledError:
|
||||||
res = None
|
res = None
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
|
|
||||||
Timeouts
|
Timeouts
|
||||||
========
|
========
|
||||||
|
|
||||||
.. coroutinefunction:: wait_for(aw, timeout, \*, loop=None)
|
.. coroutinefunction:: wait_for(aw, timeout)
|
||||||
|
|
||||||
Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
|
Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
|
||||||
to complete with a timeout.
|
to complete with a timeout.
|
||||||
|
@ -466,9 +457,6 @@ Timeouts
|
||||||
|
|
||||||
If the wait is cancelled, the future *aw* is also cancelled.
|
If the wait is cancelled, the future *aw* is also cancelled.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. _asyncio_example_waitfor:
|
.. _asyncio_example_waitfor:
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
@ -500,8 +488,7 @@ Timeouts
|
||||||
Waiting Primitives
|
Waiting Primitives
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. coroutinefunction:: wait(aws, \*, loop=None, timeout=None,\
|
.. coroutinefunction:: wait(aws, \*, timeout=None, return_when=ALL_COMPLETED)
|
||||||
return_when=ALL_COMPLETED)
|
|
||||||
|
|
||||||
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
||||||
iterable concurrently and block until the condition specified
|
iterable concurrently and block until the condition specified
|
||||||
|
@ -553,10 +540,6 @@ Waiting Primitives
|
||||||
``wait()`` directly is deprecated as it leads to
|
``wait()`` directly is deprecated as it leads to
|
||||||
:ref:`confusing behavior <asyncio_example_wait_coroutine>`.
|
:ref:`confusing behavior <asyncio_example_wait_coroutine>`.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
.. _asyncio_example_wait_coroutine:
|
.. _asyncio_example_wait_coroutine:
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
@ -590,7 +573,7 @@ Waiting Primitives
|
||||||
deprecated.
|
deprecated.
|
||||||
|
|
||||||
|
|
||||||
.. function:: as_completed(aws, \*, loop=None, timeout=None)
|
.. function:: as_completed(aws, \*, timeout=None)
|
||||||
|
|
||||||
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
||||||
iterable concurrently. Return an iterator of coroutines.
|
iterable concurrently. Return an iterator of coroutines.
|
||||||
|
@ -600,9 +583,6 @@ Waiting Primitives
|
||||||
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
|
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
|
||||||
all Futures are done.
|
all Futures are done.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.8 3.10
|
|
||||||
The *loop* parameter.
|
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
for coro in as_completed(aws):
|
for coro in as_completed(aws):
|
||||||
|
|
Loading…
Reference in New Issue