summaryrefslogtreecommitdiff
path: root/astroid/nodes/node_classes.py
diff options
context:
space:
mode:
authorDaniël van Noord <13665637+DanielNoord@users.noreply.github.com>2023-04-03 21:50:41 +0200
committerDaniël van Noord <13665637+DanielNoord@users.noreply.github.com>2023-04-03 22:22:40 +0200
commitb72eaa7d0440701a72e7b79ca9b1f7e8e9603b74 (patch)
treecf7ae6b9a2950cd2c6ac86ac6086585f0647ff53 /astroid/nodes/node_classes.py
parent5ed92d9f8f0b05fb447634496674e41837c4027b (diff)
downloadastroid-git-b72eaa7d0440701a72e7b79ca9b1f7e8e9603b74.tar.gz
Fix constructors of ``Keyword``
Diffstat (limited to 'astroid/nodes/node_classes.py')
-rw-r--r--astroid/nodes/node_classes.py41
1 files changed, 11 insertions, 30 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index eea74e7f..d2b9def6 100644
--- a/astroid/nodes/node_classes.py
+++ b/astroid/nodes/node_classes.py
@@ -3048,37 +3048,22 @@ class Keyword(NodeNG):
_astroid_fields = ("value",)
_other_fields = ("arg",)
+ value: NodeNG
+ """The value being assigned to the keyword argument."""
+
def __init__(
self,
- arg: str | None = None,
- lineno: int | None = None,
- col_offset: int | None = None,
- parent: NodeNG | None = None,
+ arg: str | None,
+ lineno: int | None,
+ col_offset: int | None,
+ parent: NodeNG,
*,
- end_lineno: int | None = None,
- end_col_offset: int | None = None,
+ end_lineno: int | None,
+ end_col_offset: int | None,
) -> None:
- """
- :param arg: The argument being assigned to.
-
- :param lineno: The line that this node appears on in the source code.
-
- :param col_offset: The column that this node appears on in the
- source code.
-
- :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.arg: str | None = arg # can be None
+ self.arg = arg
"""The argument being assigned to."""
- self.value: NodeNG | None = None
- """The value being assigned to the keyword argument."""
-
super().__init__(
lineno=lineno,
col_offset=col_offset,
@@ -3087,11 +3072,7 @@ class Keyword(NodeNG):
parent=parent,
)
- def postinit(self, value: NodeNG | None = None) -> None:
- """Do some setup after initialisation.
-
- :param value: The value being assigned to the keyword argument.
- """
+ def postinit(self, value: NodeNG) -> None:
self.value = value
def get_children(self):