API reference
python:astx:astx.system.AssertStmt
class AssertStmt
AssertStmt(condition: astx.Expr, message: astx.Expr | None = None, loc: astx.SourceLocation = astx.base.NO_SOURCE_LOCATION, parent: astx.ASTNodes[astx.AST] | None = None)
Source: packages/astx/src/astx/system.py:15
AssertStmt AST class.
Represent one fatal assertion statement with an optional failure message.
Attributes
-
condition — Type: astx.Expr
-
message — Type: astx.Expr | None
-
loc — Type: astx.SourceLocation
Methods
-
__init__ — Initialize AssertStmt.
-
__str__ — Render one assertion statement as text.
-
get_struct — Return the AST structure of the assertion statement.