[doc] Remove mention of async and await as soft keywords (GH-22144)

This commit is contained in:
Andre Delfino 2020-10-12 10:52:30 -03:00 committed by GitHub
parent 13ff396c01
commit 8adf8d1ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -768,10 +768,8 @@ Coroutine function definition
keyword: await keyword: await
Execution of Python coroutines can be suspended and resumed at many points Execution of Python coroutines can be suspended and resumed at many points
(see :term:`coroutine`). Inside the body of a coroutine function, ``await`` and (see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` and
``async`` identifiers become reserved keywords; :keyword:`await` expressions, :keyword:`async with` can only be used in the body of a coroutine function.
:keyword:`async for` and :keyword:`async with` can only be used in
coroutine function bodies.
Functions defined with ``async def`` syntax are always coroutine functions, Functions defined with ``async def`` syntax are always coroutine functions,
even if they do not contain ``await`` or ``async`` keywords. even if they do not contain ``await`` or ``async`` keywords.
@ -785,6 +783,9 @@ An example of a coroutine function::
do_stuff() do_stuff()
await some_coroutine() await some_coroutine()
.. versionchanged:: 3.7
``await`` and ``async`` are now keywords; previously they were only
treated as such inside the body of a coroutine function.
.. index:: statement: async for .. index:: statement: async for
.. _`async for`: .. _`async for`: