astx.collections.list
astx.collections.list
Source: packages/astx/src/astx/collections/list.py
title: ASTx list helper AST nodes.
summary: >-
Provide the smallest explicit list-construction and query API that host
frontends can target when they need to build list values incrementally or
reason about list metadata in lowered control-flow contexts.Classes
ListCreate(astx.base.DataType)
title: Internal empty-list constructor node.
attributes:
element_type:
type: astx.DataType
type_:
type: astx.ListTypeMethods
get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Return the structured representation.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStructListIndex(astx.base.DataType)
title: Internal list indexing node.
summary: >-
Read one element from a list-valued expression using one integer index.
attributes:
base:
type: astx.AST
index:
type: astx.AST
type_:
type: astx.DataTypeMethods
get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Return the structured representation.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStructListAppend(astx.base.DataType)
title: Internal list append node.
summary: >-
Append one value to an existing mutable list variable or field. This node
models incremental list growth and is not a user-facing collection API by
itself.
attributes:
base:
type: astx.AST
value:
type: astx.AST
type_:
type: astx.Int32Methods
get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Return the structured representation.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStructListLength(astx.base.DataType)
title: Internal list length node.
summary: >-
Return the current logical length of one list-valued expression as an
int32 value. The runtime stores list lengths as int64, but the current
ASTx language-level contract intentionally truncates that representation
to Int32.
attributes:
base:
type: astx.AST
type_:
type: astx.Int32Methods
get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Return the structured representation.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStruct