API reference
python:astx:astx.flows.IfExpr
class IfExpr
IfExpr(condition: Expr, then: Block, else_: Optional[Block] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/flows.py:114
AST class for if expression.
Attributes
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
condition — Type: Expr
-
then — Type: Block
-
else_ — Type: Optional[Block]
Methods
-
__init__ — Initialize the IfExpr instance.
-
__str__ — Return a string representation of the object.
-
get_struct — Return the AST structure of the object.