synt.expr.subscript
¤
slice_
module-attribute
¤
Alias Slice
.
Notes
slice
is a built-in type in Python, so it's renamed to slice_
with a suffix.
Subscript
¤
Bases: Expression
Subscript operation.
References
Source code in synt/expr/subscript.py
slices
instance-attribute
¤
|
Slices to index the target.
__init__
¤
|
Initialize a Subscript
operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target |
IntoExpression
|
Target of the operation. |
required |
slices |
list[Slice | IntoExpression]
|
Slices to index the target. |
required |
Source code in synt/expr/subscript.py
Slice
¤
Bases: IntoCode
Slice constructor.
Examples:
References
Source code in synt/expr/subscript.py
step
instance-attribute
¤
|
Step of the slice.
__init__
¤
|
Initialize the slice.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lower |
IntoExpression
|
Lower bound of the slice. |
required |
upper |
IntoExpression
|
Upper bound of the slice. |
required |
step |
IntoExpression | None
|
Step of the slice. |
None
|