File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -768,10 +768,8 @@ Coroutine function definition
768
768
keyword: await
769
769
770
770
Execution of Python coroutines can be suspended and resumed at many points
771
- (see :term: `coroutine `). Inside the body of a coroutine function, ``await `` and
772
- ``async `` identifiers become reserved keywords; :keyword: `await ` expressions,
773
- :keyword: `async for ` and :keyword: `async with ` can only be used in
774
- coroutine function bodies.
771
+ (see :term: `coroutine `). :keyword: `await ` expressions, :keyword: `async for ` and
772
+ :keyword: `async with ` can only be used in the body of a coroutine function.
775
773
776
774
Functions defined with ``async def `` syntax are always coroutine functions,
777
775
even if they do not contain ``await `` or ``async `` keywords.
@@ -785,6 +783,9 @@ An example of a coroutine function::
785
783
do_stuff()
786
784
await some_coroutine()
787
785
786
+ .. versionchanged :: 3.7
787
+ ``await `` and ``async `` are now keywords; previously they were only
788
+ treated as such inside the body of a coroutine function.
788
789
789
790
.. index :: statement: async for
790
791
.. _`async for` :
You can’t perform that action at this time.
0 commit comments