API reference
python:astx:astx.SubscriptExpr
class SubscriptExpr
SubscriptExpr(value: Expr, index: Optional[Expr] = None, lower: Optional[Expr] = None, upper: Optional[Expr] = None, step: Optional[Expr] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/subscript.py:24
Declared as: python:astx:astx.subscript.SubscriptExpr
AST class for subscript expressions.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
type_ — Type associated with this expression.; Type: DataType
-
value — Stored value.; Type: Expr
-
index — Index selecting the item.; Type: Expr
-
lower — Lower bound.; Type: Expr
-
upper — Upper bound.; Type: Expr
-
step — Iteration stride.; Type: Expr
-
is_slice — Distinguish omitted slice bounds from an explicit none index.; Type: bool
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize the SubscriptExpr instance.
-
__str__ — Return a string that represents the object.
-
_get_struct_wrapper — Return the AST structure of the object.
-
get_struct — Return the AST structure of the object.