API reference
python:astx:astx.types.generic.GeneratorType
class GeneratorType
GeneratorType(yield_type: astx.DataType)
Source: packages/astx/src/astx/types/generic.py:121
First-class generator object type.
Represent one stateful generator value that yields values of one statically known element type when iterated.
Attributes
-
yield_type — Type of yield.; Type: astx.DataType
-
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__ — Initialize one generator type.
-
__str__ — Render one generator type as text.
-
get_struct — Build one repr structure for a generator type.