diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2023-04-03 23:31:20 +0200 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-04-04 09:35:20 +0200 |
| commit | be6b61f84230ee0043806b4d153d5f49d3e0743b (patch) | |
| tree | 01af903b90ade387699fbbe0613ca25bdad082a9 /astroid/nodes/node_classes.py | |
| parent | a592849f4ab9d16cc1f3b7ffd39aa49a649e501a (diff) | |
| download | astroid-git-be6b61f84230ee0043806b4d153d5f49d3e0743b.tar.gz | |
Fix constructors of ``Call``
Diffstat (limited to 'astroid/nodes/node_classes.py')
| -rw-r--r-- | astroid/nodes/node_classes.py | 61 |
1 files changed, 9 insertions, 52 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index 35bb690a..eebeddff 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -1427,64 +1427,21 @@ class Call(NodeNG): _astroid_fields = ("func", "args", "keywords") - 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. + func: NodeNG + """What is being called.""" - :param col_offset: The column that this node appears on in the - source code. + args: list[NodeNG] + """The positional arguments being given to the call.""" - :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.func: NodeNG | None = None - """What is being called.""" - - self.args: list[NodeNG] = [] - """The positional arguments being given to the call.""" - - self.keywords: list[Keyword] = [] - """The keyword arguments being given to the call.""" - - super().__init__( - lineno=lineno, - col_offset=col_offset, - end_lineno=end_lineno, - end_col_offset=end_col_offset, - parent=parent, - ) + keywords: list[Keyword] + """The keyword arguments being given to the call.""" def postinit( - self, - func: NodeNG | None = None, - args: list[NodeNG] | None = None, - keywords: list[Keyword] | None = None, + self, func: NodeNG, args: list[NodeNG], keywords: list[Keyword] ) -> None: - """Do some setup after initialisation. - - :param func: What is being called. - - :param args: The positional arguments being given to the call. - - :param keywords: The keyword arguments being given to the call. - """ self.func = func - if args is not None: - self.args = args - if keywords is not None: - self.keywords = keywords + self.args = args + self.keywords = keywords @property def starargs(self) -> list[Starred]: |
