API reference
python:astx:astx.iterables.DictComprehension
class DictComprehension
DictComprehension(key: astx.Expr, value: astx.Expr, generators: astx.ASTNodes[astx.ComprehensionClause] | Iterable[astx.ComprehensionClause] = (), loc: SourceLocation = NO_SOURCE_LOCATION, parent: astx.ASTNodes | None = None)
Source: packages/astx/src/astx/iterables.py:99
Internal dictionary comprehension node.
Represent {key: value for ...} until upstream ASTx exposes a canonical dictionary-comprehension expression node.
Attributes
-
key — Type: astx.Expr
-
value — Type: astx.Expr
Methods
-
__init__ — Initialize one dictionary comprehension.
-
__str__ — Return a compact display string.
-
get_struct — Return the structured representation.