API reference
python:astx:astx.flows.IfStmt.__init__
method __init__
__init__(condition: Expr, then: Block, else_: Optional[Block] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None) -> None
Source: packages/astx/src/astx/flows.py:46
Initialize the IfStmt instance.
Parameters
-
condition — Condition controlling the operation.; Type: Expr
-
then — Then.; Type: Block
-
else_ — Else.; Type: Optional[Block]
-
loc — Source coordinates associated with the node.; Type: SourceLocation
-
parent — Parent node or enclosing scope.; Type: Optional[ASTNodes]
Returns
Type: None