Subscript¶
- class astroid.nodes.Subscript(ctx: Context, lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]¶
Bases:
NodeNG
Class representing an
ast.Subscript
node.>>> import astroid >>> node = astroid.extract_node('things[1:3]') >>> node <Subscript l.1 at 0x7f23b2e71f60>
- ctx¶
Whether the subscripted item is assigned to or loaded from.
- infer_lhs(**kwargs: _P.kwargs) Generator[InferenceResult] ¶