PEP 3129 - Class Decorators The proposal that added class decorators. Function and method decorators were introduced in PEP 318 . The Python Language Reference, Release 3.9.5 New in version 3.5. 8.8 Coroutines 8.8.1 Coroutine function definition 8.8.2 The $_{async for}$statement 103 8.8. Coroutines (continues on next page) iter =(ITER) iter =type(iter).__aiter__ (iter) running = True while running: try : TARGET = await type(iter).__anext__ (iter) except StopAsyncIteration: running = False else : SUITE else : async for TARGET in ITER: SUITE else : SUITE2 Is semantically equivalent to: The$_{async for}$statement allows convenient iteration over asynchronous iterables. The following code: An asynchronous iterable provides an$_{__aiter__}$ method that directly returns an asynchronous iterator , which can call asynchronous code in its$_{__anext__}$ method. $_{async_for_stmt}$::= "async" for_stmt async def func(param1, param2): do_stuff() await some_coroutine() An example of a coroutine function: It is a SyntaxError to use a yield from expression inside the body of a coroutine function. Functions defined with async def syntax are always coroutine functions, even if they do not contain await or $_{async}$keywords. Execution of Python coroutines can be suspended and resumed at many points (see coroutine ). Inside the body of a coroutine function,$_{await}$and$_{async}$identifiers become reserved keywords;$_{await}$expressions,$_{async for}$ and$_{async with}$ can only be used in coroutine function bodies. $_{async_funcdef}$::= [ decorators ] "async" "def" funcname "(" [ parameter_list ] ")" ["->" expression ] ":" suite