From 99b5121637a77fc88178d505a093e187658898c0 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 May 2022 13:45:40 +0200 Subject: [PATCH 1/2] Remove pre-Python 3.7 alternative description --- Doc/library/asyncio-task.rst | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index c104ac5b9a3b8f..c1fa145ff9bc06 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -223,21 +223,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 From d0b744a60e88fd3008ad281a0b3b1a9fecdfe155 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 May 2022 14:24:04 +0200 Subject: [PATCH 2/2] Remove a reference to 'Python 3.7+' --- Doc/library/asyncio-task.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index c1fa145ff9bc06..8e3d49dcf9d717 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -20,7 +20,7 @@ Coroutines :term:`Coroutines ` 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