API reference
python:astx:astx.comprehensions.ComprehensionClause
class ComprehensionClause
ComprehensionClause(target: Expr, iterable: Expr, conditions: Optional[Iterable[Expr] | ASTNodes[Expr]] = None, is_async: bool = False, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/comprehensions.py:26
AST node for generic comprehensions.
Attributes
-
kind — Type: ASTKind
-
target — Type: Expr
-
iterable — Type: Expr
-
conditions — Type: ASTNodes[Expr]
-
is_async — Type: bool
Methods
-
__init__ — Initialize the comprehension clause.
-
__str__ — Return a string representation of the object.
-
get_struct — Return the AST structure of the object.