diff options
| author | Sebastian Rittau <srittau@rittau.biz> | 2022-05-05 00:14:07 (GMT) | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-05 00:14:07 (GMT) | 
| commit | d1b2e989be2bc5128d6602e4f370d0ee6f5ac476 (patch) | |
| tree | d36a25b6252c1b9ff6d4bdb183c745b4cef4050e /Doc/library/asyncio-task.rst | |
| parent | e61330b44f22b11a71f5bbcc17e309dd80e3e95f (diff) | |
| download | cpython-d1b2e989be2bc5128d6602e4f370d0ee6f5ac476.zip cpython-d1b2e989be2bc5128d6602e4f370d0ee6f5ac476.tar.gz cpython-d1b2e989be2bc5128d6602e4f370d0ee6f5ac476.tar.bz2  | |
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (#92224)
Diffstat (limited to 'Doc/library/asyncio-task.rst')
| -rw-r--r-- | Doc/library/asyncio-task.rst | 17 | 
1 files changed, 1 insertions, 16 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index c104ac5..8e3d49d 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -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 @@ -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  | 
