Skip to content

Commit d1b2e98

Browse files
authored
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (#92224)
1 parent e61330b commit d1b2e98

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

Doc/library/asyncio-task.rst

+1-16
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Coroutines
2020

2121
:term:`Coroutines <coroutine>` declared with the async/await syntax is the
2222
preferred way of writing asyncio applications. For example, the following
23-
snippet of code (requires Python 3.7+) prints "hello", waits 1 second,
23+
snippet of code prints "hello", waits 1 second,
2424
and then prints "world"::
2525

2626
>>> import asyncio
@@ -223,21 +223,6 @@ Creating Tasks
223223
:exc:`RuntimeError` is raised if there is no running loop in
224224
current thread.
225225

226-
This function has been **added in Python 3.7**. Prior to
227-
Python 3.7, the low-level :func:`asyncio.ensure_future` function
228-
can be used instead::
229-
230-
async def coro():
231-
...
232-
233-
# In Python 3.7+
234-
task = asyncio.create_task(coro())
235-
...
236-
237-
# This works in all Python versions but is less readable
238-
task = asyncio.ensure_future(coro())
239-
...
240-
241226
.. important::
242227

243228
Save a reference to the result of this function, to avoid

0 commit comments

Comments
 (0)