API reference
python:astx:astx.collections.CollectionIndex
class CollectionIndex
CollectionIndex(base: astx.AST, value: astx.AST)
Source: packages/astx/src/astx/collections/common.py:167
Declared as: python:astx:astx.collections.common.CollectionIndex
Common sequence index query node.
Return the first zero-based index of a value in a list or tuple. The initial ASTx contract returns -1 when the value is not found.
Attributes
-
base — Type: astx.AST
-
value — Type: astx.AST
-
type_ — Type: astx.Int32
Methods
-
__init__ — Initialize one sequence index query.
-
get_struct — Return the structured representation.