API reference
python:astx:astx.TypeCastExpr
class TypeCastExpr
TypeCastExpr(expr: Expr, target_type: DataType, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/types/casting.py:23
Declared as: python:astx:astx.types.casting.TypeCastExpr
AST class for type casting expressions.
Attributes
-
kind — Type: ASTKind
-
expr — Type: Expr
-
target_type — Type: DataType
Methods
-
__init__ — Initialize the type-cast expression.
-
__str__ — Return a string representation of the TypeCast expression.
-
get_struct — Return the AST structure of the TypeCast expression.