bpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)

(cherry picked from commit 2923d87ca258b9d421e8147b12f0d98295ee3f8e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index b1700c9..300092d 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -343,7 +343,7 @@
    the name of the task using :meth:`Task.set_name`.
 
    .. versionchanged:: 3.8
-      Added the ``name`` parameter.
+      Added the *name* parameter.
 
 .. method:: loop.set_task_factory(factory)
 
@@ -456,7 +456,20 @@
      to wait for the TLS handshake to complete before aborting the connection.
      ``60.0`` seconds if ``None`` (default).
 
-   .. versionadded:: 3.8
+   .. versionchanged:: 3.5
+
+      Added support for SSL/TLS in :class:`ProactorEventLoop`.
+
+   .. versionchanged:: 3.6
+
+      The socket option :py:data:`~socket.TCP_NODELAY` is set by default
+      for all TCP connections.
+
+   .. versionchanged:: 3.7
+
+      Added the *ssl_handshake_timeout* parameter.
+
+   .. versionchanged:: 3.8
 
       Added the *happy_eyeballs_delay* and *interleave* parameters.
 
@@ -471,19 +484,6 @@
 
       For more information: https://tools.ietf.org/html/rfc6555
 
-   .. versionadded:: 3.7
-
-      The *ssl_handshake_timeout* parameter.
-
-   .. versionchanged:: 3.6
-
-      The socket option :py:data:`~socket.TCP_NODELAY` is set by default
-      for all TCP connections.
-
-   .. versionchanged:: 3.5
-
-      Added support for SSL/TLS in :class:`ProactorEventLoop`.
-
    .. seealso::
 
       The :func:`open_connection` function is a high-level alternative
@@ -588,12 +588,8 @@
 
    .. availability:: Unix.
 
-   .. versionadded:: 3.7
-
-      The *ssl_handshake_timeout* parameter.
-
    .. versionchanged:: 3.7
-
+      Added the *ssl_handshake_timeout* parameter.
       The *path* parameter can now be a :term:`path-like object`.
 
 
@@ -672,15 +668,6 @@
      :meth:`Server.serve_forever` to make the server to start accepting
      connections.
 
-   .. versionadded:: 3.7
-
-      Added *ssl_handshake_timeout* and *start_serving* parameters.
-
-   .. versionchanged:: 3.6
-
-      The socket option :py:data:`~socket.TCP_NODELAY` is set by default
-      for all TCP connections.
-
    .. versionchanged:: 3.5
 
       Added support for SSL/TLS in :class:`ProactorEventLoop`.
@@ -689,6 +676,12 @@
 
       The *host* parameter can be a sequence of strings.
 
+   .. versionchanged:: 3.6
+
+      Added *ssl_handshake_timeout* and *start_serving* parameters.
+      The socket option :py:data:`~socket.TCP_NODELAY` is set by default
+      for all TCP connections.
+
    .. seealso::
 
       The :func:`start_server` function is a higher-level alternative API
@@ -713,12 +706,9 @@
 
    .. availability:: Unix.
 
-   .. versionadded:: 3.7
-
-      The *ssl_handshake_timeout* and *start_serving* parameters.
-
    .. versionchanged:: 3.7
 
+      Added the *ssl_handshake_timeout* and *start_serving* parameters.
       The *path* parameter can now be a :class:`~pathlib.Path` object.
 
 .. coroutinemethod:: loop.connect_accepted_socket(protocol_factory, \
@@ -746,12 +736,12 @@
 
    Returns a ``(transport, protocol)`` pair.
 
-   .. versionadded:: 3.7
-
-      The *ssl_handshake_timeout* parameter.
-
    .. versionadded:: 3.5.3
 
+   .. versionchanged:: 3.7
+
+      Added the *ssl_handshake_timeout* parameter.
+
 
 Transferring files
 ^^^^^^^^^^^^^^^^^^
diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst
index 3496387..7426e82 100644
--- a/Doc/library/asyncio-future.rst
+++ b/Doc/library/asyncio-future.rst
@@ -194,7 +194,7 @@
       schedule the callbacks, and return ``True``.
 
       .. versionchanged:: 3.9
-         Added the ``msg`` parameter.
+         Added the *msg* parameter.
 
    .. method:: exception()
 
diff --git a/Doc/library/asyncio-queue.rst b/Doc/library/asyncio-queue.rst
index e6f26bb..d86fbc2 100644
--- a/Doc/library/asyncio-queue.rst
+++ b/Doc/library/asyncio-queue.rst
@@ -36,6 +36,9 @@
    the queue is always known and can be returned by calling the
    :meth:`qsize` method.
 
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
+
 
    This class is :ref:`not thread safe <asyncio-multithreading>`.
 
@@ -105,13 +108,6 @@
       Raises :exc:`ValueError` if called more times than there were
       items placed in the queue.
 
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
-
 
 Priority Queue
 ==============
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
index 95a8e46..269c3dc 100644
--- a/Doc/library/asyncio-stream.rst
+++ b/Doc/library/asyncio-stream.rst
@@ -66,16 +66,11 @@
    The rest of the arguments are passed directly to
    :meth:`loop.create_connection`.
 
-   .. versionadded:: 3.7
+   .. versionchanged:: 3.7
+      Added the *ssl_handshake_timeout* parameter.
 
-      The *ssl_handshake_timeout* parameter.
-
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 .. coroutinefunction:: start_server(client_connected_cb, host=None, \
@@ -104,16 +99,11 @@
    The rest of the arguments are passed directly to
    :meth:`loop.create_server`.
 
-   .. versionadded:: 3.7
+   .. versionchanged:: 3.7
+      Added the *ssl_handshake_timeout* and *start_serving* parameters.
 
-      The *ssl_handshake_timeout* and *start_serving* parameters.
-
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 .. rubric:: Unix Sockets
@@ -131,20 +121,12 @@
 
    .. availability:: Unix.
 
-   .. versionadded:: 3.7
-
-      The *ssl_handshake_timeout* parameter.
-
    .. versionchanged:: 3.7
-
+      Added the *ssl_handshake_timeout* parameter.
       The *path* parameter can now be a :term:`path-like object`
 
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 .. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
@@ -159,20 +141,12 @@
 
    .. availability:: Unix.
 
-   .. versionadded:: 3.7
-
-      The *ssl_handshake_timeout* and *start_serving* parameters.
-
    .. versionchanged:: 3.7
-
+      Added the *ssl_handshake_timeout* and *start_serving* parameters.
       The *path* parameter can now be a :term:`path-like object`.
 
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 StreamReader
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst
index fd1f9c9..748b704 100644
--- a/Doc/library/asyncio-subprocess.rst
+++ b/Doc/library/asyncio-subprocess.rst
@@ -75,12 +75,8 @@
    See the documentation of :meth:`loop.subprocess_exec` for other
    parameters.
 
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 .. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
@@ -106,12 +102,8 @@
       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.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 .. note::
 
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
index 88e523a..f4063db 100644
--- a/Doc/library/asyncio-sync.rst
+++ b/Doc/library/asyncio-sync.rst
@@ -63,11 +63,8 @@
        finally:
            lock.release()
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This class has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. coroutinemethod:: acquire()
 
@@ -111,11 +108,8 @@
    :meth:`clear` method.  The :meth:`~Event.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.  This class has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. _asyncio_example_sync_event:
 
@@ -189,11 +183,8 @@
    ``None``.  In the latter case a new Lock object is created
    automatically.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This class has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    The preferred way to use a Condition is an :keyword:`async with`
    statement::
@@ -291,11 +282,8 @@
    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.  This class has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    The preferred way to use a Semaphore is an :keyword:`async with`
    statement::
@@ -349,12 +337,8 @@
    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.  This class has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 ---------
 
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 7f4cc70..efd4d1b 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -282,7 +282,7 @@
    .. versionadded:: 3.7
 
    .. versionchanged:: 3.8
-      Added the ``name`` parameter.
+      Added the *name* parameter.
 
 
 Sleeping
@@ -328,12 +328,8 @@
     asyncio.run(display_date())
 
 
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 Running Tasks Concurrently
@@ -368,11 +364,8 @@
    cancellation of one submitted Task/Future to cause other
    Tasks/Futures to be cancelled.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. _asyncio_example_gather:
 
@@ -425,11 +418,8 @@
       If the *gather* itself is cancelled, the cancellation is
       propagated regardless of *return_exceptions*.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. deprecated:: 3.10
       Deprecation warning is emitted if no positional arguments are provided
@@ -473,11 +463,8 @@
        except CancelledError:
            res = None
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. deprecated:: 3.10
       Deprecation warning is emitted if *aw* is not Future-like object
@@ -510,11 +497,8 @@
 
    If the wait is cancelled, the future *aw* is also cancelled.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. _asyncio_example_waitfor:
 
@@ -543,11 +527,8 @@
       for *aw* to be cancelled.  Previously, it raised
       :exc:`asyncio.TimeoutError` immediately.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
 
 Waiting Primitives
@@ -605,11 +586,8 @@
       ``wait()`` directly is deprecated as it leads to
       :ref:`confusing behavior <asyncio_example_wait_coroutine>`.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. _asyncio_example_wait_coroutine:
    .. note::
@@ -638,18 +616,14 @@
           if task in done:
               # Everything will work as expected now.
 
-   .. deprecated-removed:: 3.8 3.10
-
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
-
    .. deprecated-removed:: 3.8 3.11
 
       Passing coroutine objects to ``wait()`` directly is
       deprecated.
 
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
+
 
 .. function:: as_completed(aws, *, timeout=None)
 
@@ -661,11 +635,8 @@
    Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
    all Futures are done.
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    Example::
 
@@ -673,11 +644,8 @@
            earliest_result = await coro
            # ...
 
-   .. deprecated-removed:: 3.8 3.10
-      The ``loop`` parameter.  This function has been implicitly getting the
-      current running loop since 3.7.  See
-      :ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
-      for more information.
+   .. versionchanged:: 3.10
+      Removed the *loop* parameter.
 
    .. deprecated:: 3.10
       Deprecation warning is emitted if not all awaitable objects in the *aws*
@@ -860,10 +828,7 @@
       Added support for the :mod:`contextvars` module.
 
    .. versionchanged:: 3.8
-      Added the ``name`` parameter.
-
-   .. deprecated-removed:: 3.8 3.10
-      The *loop* parameter.
+      Added the *name* parameter.
 
    .. deprecated:: 3.10
       Deprecation warning is emitted if *loop* is not specified
@@ -885,7 +850,7 @@
       discouraged.
 
       .. versionchanged:: 3.9
-         Added the ``msg`` parameter.
+         Added the *msg* parameter.
 
       .. _asyncio_example_task_cancel: