AsyncFunctionDef

class astroid.nodes.AsyncFunctionDef(name: str, lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]

Bases: FunctionDef

Class representing an ast.FunctionDef node.

A AsyncFunctionDef is an asynchronous function created with the async keyword.

>>> import astroid
>>> node = astroid.extract_node('''
... async def func(things):
...     async for thing in things:
...         print(thing)
... ''')
>>> node
<AsyncFunctionDef.func l.2 at 0x...>
>>> node.body[0]
<AsyncFor l.3 at 0x...>