BaseContainer¶
- class astroid.nodes.BaseContainer(lineno: int | None, col_offset: int | None, parent: NodeNG | None, *, end_lineno: int | None, end_col_offset: int | None)[source]¶
Bases:
ParentAssignNode
,Instance
Base class for Set, FrozenSet, Tuple and List.
- bool_value(context: InferenceContext | None = None) bool [source]¶
Determine the boolean value of this node.
- Returns:
The boolean value of this node.
- classmethod from_elements(elts: Iterable[Any]) Self [source]¶
Create a node of this type from the given list of elements.
- Parameters:
elts – The list of elements that the node should contain.
- Returns:
A new node containing the given elements.