AsyncFor¶
- class astroid.nodes.AsyncFor(lineno: int | None, col_offset: int | None, parent: NodeNG | None, *, end_lineno: int | None, end_col_offset: int | None)[source]¶
Bases:
For
Class representing an
ast.AsyncFor
node.An
AsyncFor
is an asynchronousFor
built with theasync
keyword.>>> import astroid >>> node = astroid.extract_node(''' async def func(things): async for thing in things: print(thing) ''') >>> node <AsyncFunctionDef.func l.2 at 0x7f23b2e416d8> >>> node.body[0] <AsyncFor l.3 at 0x7f23b2e417b8>