Skip to content

Commit bb2dcf1

Browse files
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (GH-92224)
(cherry picked from commit d1b2e98) Co-authored-by: Sebastian Rittau <[email protected]>
1 parent 178a238 commit bb2dcf1

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
@@ -259,21 +259,6 @@ Creating Tasks
259259
:exc:`RuntimeError` is raised if there is no running loop in
260260
current thread.
261261

262-
This function has been **added in Python 3.7**. Prior to
263-
Python 3.7, the low-level :func:`asyncio.ensure_future` function
264-
can be used instead::
265-
266-
async def coro():
267-
...
268-
269-
# In Python 3.7+
270-
task = asyncio.create_task(coro())
271-
...
272-
273-
# This works in all Python versions but is less readable
274-
task = asyncio.ensure_future(coro())
275-
...
276-
277262
.. important::
278263

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

0 commit comments

Comments
 (0)