DictComp¶
- class astroid.nodes.DictComp(lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]¶
Bases:
ComprehensionScope
Class representing an
ast.DictComp
node.>>> import astroid >>> node = astroid.extract_node('{k:v for k, v in things if k > v}') >>> node <DictComp l.1 at 0x7f23b2e41d68>
- bool_value(context: InferenceContext | None = None)[source]¶
Determine the boolean value of this node.
- Returns:
The boolean value of this node. For a
DictComp
this is alwaysUninferable
.- Return type:
Uninferable