summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--astroid/nodes/node_classes.py56
2 files changed, 10 insertions, 47 deletions
diff --git a/ChangeLog b/ChangeLog
index 77ccf932..c020e4b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@ Release date: TBA
- ``nodes.IfExp``
- ``nodes.Keyword``
- ``nodes.Name``
+ - ``nodes.Slice``
- ``nodes.Starred``
- ``nodes.Subscript``
- ``nodes.UnaryOp``
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index 2b24d8ef..bb581af9 100644
--- a/astroid/nodes/node_classes.py
+++ b/astroid/nodes/node_classes.py
@@ -3160,59 +3160,21 @@ class Slice(NodeNG):
_astroid_fields = ("lower", "upper", "step")
- def __init__(
- self,
- lineno: int | None = None,
- col_offset: int | None = None,
- parent: NodeNG | None = None,
- *,
- end_lineno: int | None = None,
- end_col_offset: int | None = None,
- ) -> None:
- """
- :param lineno: The line that this node appears on in the source code.
+ lower: NodeNG | None
+ """The lower index in the slice."""
- :param col_offset: The column that this node appears on in the
- source code.
+ upper: NodeNG | None
+ """The upper index in the slice."""
- :param parent: The parent node in the syntax tree.
-
- :param end_lineno: The last line this node appears on in the source code.
-
- :param end_col_offset: The end column this node appears on in the
- source code. Note: This is after the last symbol.
- """
- self.lower: NodeNG | None = None # can be None
- """The lower index in the slice."""
-
- self.upper: NodeNG | None = None # can be None
- """The upper index in the slice."""
-
- self.step: NodeNG | None = None # can be None
- """The step to take between indexes."""
-
- super().__init__(
- lineno=lineno,
- col_offset=col_offset,
- end_lineno=end_lineno,
- end_col_offset=end_col_offset,
- parent=parent,
- )
+ step: NodeNG | None
+ """The step to take between indexes."""
def postinit(
self,
- lower: NodeNG | None = None,
- upper: NodeNG | None = None,
- step: NodeNG | None = None,
+ lower: NodeNG | None,
+ upper: NodeNG | None,
+ step: NodeNG | None,
) -> None:
- """Do some setup after initialisation.
-
- :param lower: The lower index in the slice.
-
- :param upper: The upper index in the slice.
-
- :param step: The step to take between index.
- """
self.lower = lower
self.upper = upper
self.step = step