API reference
python:astx:astx.collections.CollectionLength
class CollectionLength
CollectionLength(base: astx.AST)
Source: packages/astx/src/astx/collections/common.py:17
Declared as: python:astx:astx.collections.common.CollectionLength
Common collection length query node.
Return the logical length of a list, tuple, set, dictionary, or string as an Int64 value. String length counts Unicode code points.
Attributes
-
base — Base value or declaration.; Type: astx.AST
-
type_ — Type associated with this expression.; Type: astx.Int64
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize one collection length query.
-
get_struct — Return the structured representation.