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:
FunctionDefClass representing an
ast.FunctionDefnode.A
AsyncFunctionDefis an asynchronous function created with theasynckeyword.>>> 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...>