API reference
python:astx:astx.Cast
class Cast
Cast(value: astx.DataType, target_type: astx.DataType, *, mode: NumericMode = NumericMode.CHECKED)
Source: packages/astx/src/astx/system.py:113
Declared as: python:astx:astx.system.Cast
Cast AST node for type conversions.
Represents a cast of value to a specified target_type.
Attributes
-
value — Stored value.; Type: astx.DataType
-
target_type — Destination type for the conversion.; Type: astx.DataType
-
mode — Selected processing mode.; Type: NumericMode
-
type_ — Type associated with this expression.; Type: astx.DataType
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize Cast.
-
get_struct — Return the structured representation of the cast expression.