API reference
python:astx:astx.IterationConstraint
class IterationConstraint
IterationConstraint(element_type: DataType, *, requires_iterator: bool = False)
Source: packages/astx/src/astx/types/collections.py:77
Declared as: python:astx:astx.types.collections.IterationConstraint
Structural iteration bound for a concrete template argument.
Attributes
-
element_type — Exact type of yielded items.; Type: DataType
-
requires_iterator — Whether the input must itself support advancement.; Type: bool
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
type_ — Type: ExprType
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Require an iterable or iterator over a specific item type.
-
__str__ — Render the constraint and its item type.