]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (GH-92224)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 5 May 2022 00:36:04 +0000 (17:36 -0700)
committerGitHub <noreply@github.com>
Thu, 5 May 2022 00:36:04 +0000 (17:36 -0700)
(cherry picked from commit d1b2e989be2bc5128d6602e4f370d0ee6f5ac476)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Doc/library/asyncio-task.rst

index 38b12e44b6de2830ebb00825eebcc9e5f6e18802..7c12e2eda1c4ccf53676ce03c561423897178e0c 100644 (file)
@@ -20,7 +20,7 @@ Coroutines
 
 :term:`Coroutines <coroutine>` declared with the async/await syntax is the
 preferred way of writing asyncio applications.  For example, the following
-snippet of code (requires Python 3.7+) prints "hello", waits 1 second,
+snippet of code prints "hello", waits 1 second,
 and then prints "world"::
 
     >>> import asyncio
@@ -259,21 +259,6 @@ Creating Tasks
    :exc:`RuntimeError` is raised if there is no running loop in
    current thread.
 
-   This function has been **added in Python 3.7**.  Prior to
-   Python 3.7, the low-level :func:`asyncio.ensure_future` function
-   can be used instead::
-
-       async def coro():
-           ...
-
-       # In Python 3.7+
-       task = asyncio.create_task(coro())
-       ...
-
-       # This works in all Python versions but is less readable
-       task = asyncio.ensure_future(coro())
-       ...
-
    .. important::
 
       Save a reference to the result of this function, to avoid