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 — Kind of value or operation.; Type: ASTKind
-
target — Destination of the operation.; Type: Expr
-
iterable — Iterable.; Type: Expr
-
conditions — Conditions.; Type: ASTNodes[Expr]
-
is_async — Whether is async.; Type: bool
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
Methods
-
__init__ — Initialize the comprehension clause.
-
__str__ — Return a string representation of the object.
-
get_struct — Return the AST structure of the object.