Skip to content

bpo-42392: Remove deprecated loop parameter from docs #23552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Doc/library/asyncio-queue.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See also the `Examples`_ section below.
Queue
=====

.. class:: Queue(maxsize=0, \*, loop=None)
.. class:: Queue(maxsize=0)

A first in, first out (FIFO) queue.

Expand All @@ -36,9 +36,6 @@ Queue
the queue is always known and can be returned by calling the
:meth:`qsize` method.

.. deprecated-removed:: 3.8 3.10
The *loop* parameter.


This class is :ref:`not thread safe <asyncio-multithreading>`.

Expand Down
23 changes: 8 additions & 15 deletions Doc/library/asyncio-stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ and work with streams:


.. coroutinefunction:: open_connection(host=None, port=None, \*, \
loop=None, limit=None, ssl=None, family=0, \
proto=0, flags=0, sock=None, local_addr=None, \
limit=None, ssl=None, family=0, proto=0, \
flags=0, sock=None, local_addr=None, \
server_hostname=None, ssl_handshake_timeout=None)

Establish a network connection and return a pair of
Expand All @@ -59,9 +59,6 @@ and work with streams:
The returned *reader* and *writer* objects are instances of
: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
returned :class:`StreamReader` instance. By default the *limit*
is set to 64 KiB.
Expand All @@ -74,7 +71,7 @@ and work with streams:
The *ssl_handshake_timeout* parameter.

.. coroutinefunction:: start_server(client_connected_cb, host=None, \
port=None, \*, loop=None, limit=None, \
port=None, \*, limit=None, \
family=socket.AF_UNSPEC, \
flags=socket.AI_PASSIVE, sock=None, \
backlog=100, ssl=None, reuse_address=None, \
Expand All @@ -92,9 +89,6 @@ and work with streams:
:ref:`coroutine function <coroutine>`; if it is a coroutine function,
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
returned :class:`StreamReader` instance. By default the *limit*
is set to 64 KiB.
Expand All @@ -109,9 +103,9 @@ and work with streams:

.. rubric:: Unix Sockets

.. coroutinefunction:: open_unix_connection(path=None, \*, loop=None, \
limit=None, ssl=None, sock=None, \
server_hostname=None, ssl_handshake_timeout=None)
.. coroutinefunction:: open_unix_connection(path=None, \*, limit=None, \
ssl=None, sock=None, server_hostname=None, \
ssl_handshake_timeout=None)

Establish a Unix socket connection and return a pair of
``(reader, writer)``.
Expand All @@ -132,9 +126,8 @@ and work with streams:


.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
\*, loop=None, limit=None, sock=None, \
backlog=100, ssl=None, ssl_handshake_timeout=None, \
start_serving=True)
\*, limit=None, sock=None, backlog=100, ssl=None, \
ssl_handshake_timeout=None, start_serving=True)

Start a Unix socket server.

Expand Down
13 changes: 2 additions & 11 deletions Doc/library/asyncio-subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ Creating Subprocesses
=====================

.. coroutinefunction:: create_subprocess_exec(program, \*args, stdin=None, \
stdout=None, stderr=None, loop=None, \
limit=None, \*\*kwds)
stdout=None, stderr=None, limit=None, \*\*kwds)

Create a subprocess.

Expand All @@ -76,13 +75,9 @@ Creating Subprocesses
See the documentation of :meth:`loop.subprocess_exec` for other
parameters.

.. deprecated-removed:: 3.8 3.10

The *loop* parameter.

.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
stdout=None, stderr=None, loop=None, \
limit=None, \*\*kwds)
stdout=None, stderr=None, limit=None, \*\*kwds)

Run the *cmd* shell command.

Expand All @@ -104,10 +99,6 @@ Creating Subprocesses
escape whitespace and special shell characters in strings that are going
to be used to construct shell commands.

.. deprecated-removed:: 3.8 3.10

The *loop* parameter.

.. note::

Subprocesses are available for Windows if a :class:`ProactorEventLoop` is
Expand Down
29 changes: 5 additions & 24 deletions Doc/library/asyncio-sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ asyncio has the following basic synchronization primitives:
Lock
====

.. class:: Lock(\*, loop=None)
.. class:: Lock()

Implements a mutex lock for asyncio tasks. Not thread-safe.

Expand All @@ -63,9 +63,6 @@ Lock
finally:
lock.release()

.. deprecated-removed:: 3.8 3.10
The *loop* parameter.

.. coroutinemethod:: acquire()

Acquire the lock.
Expand Down Expand Up @@ -96,7 +93,7 @@ Lock
Event
=====

.. class:: Event(\*, loop=None)
.. class:: Event()

An event object. Not thread-safe.

Expand All @@ -108,10 +105,6 @@ Event
:meth:`clear` method. The :meth:`wait` method blocks until the
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:

Example::
Expand Down Expand Up @@ -166,7 +159,7 @@ Event
Condition
=========

.. class:: Condition(lock=None, \*, loop=None)
.. class:: Condition(lock=None)

A Condition object. Not thread-safe.

Expand All @@ -184,10 +177,6 @@ Condition
``None``. In the latter case a new Lock object is created
automatically.


.. deprecated-removed:: 3.8 3.10
The *loop* parameter.

The preferred way to use a Condition is an :keyword:`async with`
statement::

Expand Down Expand Up @@ -270,7 +259,7 @@ Condition
Semaphore
=========

.. class:: Semaphore(value=1, \*, loop=None)
.. class:: Semaphore(value=1)

A Semaphore object. Not thread-safe.

Expand All @@ -284,10 +273,6 @@ Semaphore
internal counter (``1`` by default). If the given value is
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`
statement::

Expand Down Expand Up @@ -332,18 +317,14 @@ Semaphore
BoundedSemaphore
================

.. class:: BoundedSemaphore(value=1, \*, loop=None)
.. class:: BoundedSemaphore(value=1)

A bounded semaphore object. Not thread-safe.

Bounded Semaphore is a version of :class:`Semaphore` that raises
a :exc:`ValueError` in :meth:`~Semaphore.release` if it
increases the internal counter above the initial *value*.


.. deprecated-removed:: 3.8 3.10
The *loop* parameter.

---------


Expand Down
32 changes: 6 additions & 26 deletions Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Creating Tasks
Sleeping
========

.. coroutinefunction:: sleep(delay, result=None, \*, loop=None)
.. coroutinefunction:: sleep(delay, result=None)

Block for *delay* seconds.

Expand All @@ -293,9 +293,6 @@ Sleeping
``sleep()`` always suspends the current task, allowing other tasks
to run.

.. deprecated-removed:: 3.8 3.10
The *loop* parameter.

.. _asyncio_example_sleep:

Example of coroutine displaying the current date every second
Expand All @@ -319,7 +316,7 @@ Sleeping
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*
sequence *concurrently*.
Expand Down Expand Up @@ -348,9 +345,6 @@ 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::
Expand Down Expand Up @@ -403,7 +397,7 @@ Running Tasks Concurrently
Shielding From Cancellation
===========================

.. awaitablefunction:: shield(aw, \*, loop=None)
.. awaitablefunction:: shield(aw)

Protect an :ref:`awaitable object <asyncio-awaitables>`
from being :meth:`cancelled <Task.cancel>`.
Expand Down Expand Up @@ -436,14 +430,11 @@ Shielding From Cancellation
except CancelledError:
res = None

.. deprecated-removed:: 3.8 3.10
The *loop* parameter.


Timeouts
========

.. coroutinefunction:: wait_for(aw, timeout, \*, loop=None)
.. coroutinefunction:: wait_for(aw, timeout)

Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
to complete with a timeout.
Expand All @@ -466,9 +457,6 @@ Timeouts

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

.. deprecated-removed:: 3.8 3.10
The *loop* parameter.

.. _asyncio_example_waitfor:

Example::
Expand Down Expand Up @@ -500,8 +488,7 @@ Timeouts
Waiting Primitives
==================

.. coroutinefunction:: wait(aws, \*, loop=None, timeout=None,\
return_when=ALL_COMPLETED)
.. coroutinefunction:: wait(aws, \*, timeout=None, return_when=ALL_COMPLETED)

Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
iterable concurrently and block until the condition specified
Expand Down Expand Up @@ -553,10 +540,6 @@ Waiting Primitives
``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::

Expand Down Expand Up @@ -590,7 +573,7 @@ Waiting Primitives
deprecated.


.. function:: as_completed(aws, \*, loop=None, timeout=None)
.. function:: as_completed(aws, \*, timeout=None)

Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
iterable concurrently. Return an iterator of coroutines.
Expand All @@ -600,9 +583,6 @@ 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 coro in as_completed(aws):
Expand Down