diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2023-04-03 19:52:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-03 19:52:51 +0200 |
| commit | 00b33a5f15d238a3fe751b30e79aa212b55a14a5 (patch) | |
| tree | f5973906384f78e209a1946d08e926d7629ae86f /astroid/nodes/node_classes.py | |
| parent | c46d7e0f56105e8db67bf54888531f32120a070c (diff) | |
| download | astroid-git-00b33a5f15d238a3fe751b30e79aa212b55a14a5.tar.gz | |
Fix constructors of ``Delete`` (#2079)
Diffstat (limited to 'astroid/nodes/node_classes.py')
| -rw-r--r-- | astroid/nodes/node_classes.py | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index 6d3397bf..1bb195ae 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -2275,26 +2275,13 @@ class Delete(_base_nodes.AssignTypeNode, _base_nodes.Statement): def __init__( self, - lineno: int | None = None, - col_offset: int | None = None, - parent: NodeNG | None = None, + lineno: int, + col_offset: int, + parent: NodeNG, *, - end_lineno: int | None = None, - end_col_offset: int | None = None, + end_lineno: int | None, + end_col_offset: int | None, ) -> None: - """ - :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.targets: list[NodeNG] = [] """What is being deleted.""" @@ -2306,13 +2293,8 @@ class Delete(_base_nodes.AssignTypeNode, _base_nodes.Statement): parent=parent, ) - def postinit(self, targets: list[NodeNG] | None = None) -> None: - """Do some setup after initialisation. - - :param targets: What is being deleted. - """ - if targets is not None: - self.targets = targets + def postinit(self, targets: list[NodeNG]) -> None: + self.targets = targets def get_children(self): yield from self.targets |
