API reference
python:astx:astx.collections.list.ListExpr
class ListExpr
ListExpr(elements: Sequence[astx.Expr], loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/collections/list.py:23
Ordered expression-valued collection construction.
Evaluate elements once, left to right. Semantic analysis chooses the concrete list element type, or a tensor under an explicit tensor target. Unlike LiteralList, elements need not be literals.
Attributes
-
elements — Type: list[astx.Expr]
-
type_ — Type: AnyType
Methods
-
__init__ — Initialize a collection expression without inferring its type.
-
get_struct — Preserve each element in the structured representation.