API reference
python:astx:astx.ThrowStmt
class ThrowStmt
ThrowStmt(exception: Optional[Expr] = None, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION, *, cause: Optional[Expr] = None)
Source: packages/astx/src/astx/exceptions.py:27
Declared as: python:astx:astx.exceptions.ThrowStmt
AST class for throw statements.
An absent exception models re-raising. An absent cause differs from an explicit LiteralNone, which suppresses implicit diagnostic context.
Attributes
-
kind — Type: ASTKind
-
exception — Type: Optional[Expr]
-
cause — Type: Optional[Expr]
Methods
-
__init__ — Initialize the instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.