Skip to content

Commit

Permalink
Mark arguments as required
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Apr 25, 2023
1 parent 2568e58 commit 6a25756
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions astroid/nodes/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3048,11 +3048,11 @@ class Try(_base_nodes.MultiLineWithElseBlockNode, _base_nodes.Statement):
def __init__(
self,
*,
lineno: int | None = None,
col_offset: int | None = None,
end_lineno: int | None = None,
end_col_offset: int | None = None,
parent: NodeNG | None = None,
lineno: int,
col_offset: int,
end_lineno: int,
end_col_offset: int,
parent: NodeNG,
) -> None:
"""
:param lineno: The line that this node appears on in the source code.
Expand Down Expand Up @@ -3090,10 +3090,10 @@ def __init__(
def postinit(
self,
*,
body: list[NodeNG] | None = None,
handlers: list[ExceptHandler] | None = None,
orelse: list[NodeNG] | None = None,
finalbody: list[NodeNG] | None = None,
body: list[NodeNG],
handlers: list[ExceptHandler],
orelse: list[NodeNG],
finalbody: list[NodeNG],
) -> None:
"""Do some setup after initialisation.
Expand All @@ -3105,14 +3105,10 @@ def postinit(
:param finalbody: The contents of the ``finally`` block.
"""
if body:
self.body = body
if handlers:
self.handlers = handlers
if orelse:
self.orelse = orelse
if finalbody:
self.finalbody = finalbody
self.body = body
self.handlers = handlers
self.orelse = orelse
self.finalbody = finalbody

def _infer_name(self, frame, name):
return name
Expand Down

0 comments on commit 6a25756

Please sign in to comment.