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