Skip to content

Commit 51c7441

Browse files
Use walrus operator to avoid mypy disable
1 parent 2318a47 commit 51c7441

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pylint/checkers/refactoring/refactoring_checker.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,16 +1133,12 @@ def _check_super_with_arguments(self, node: nodes.Call) -> None:
11331133
if not isinstance(node.func, nodes.Name) or node.func.name != "super":
11341134
return
11351135

1136-
# pylint: disable=too-many-boolean-expressions
11371136
if (
11381137
len(node.args) != 2
1139-
or not isinstance(node.args[1], nodes.Name)
1138+
or not all(isinstance(arg, nodes.Name) for arg in node.args)
11401139
or node.args[1].name != "self"
1141-
or not isinstance(node.args[0], nodes.Name)
1142-
or not isinstance(node.args[1], nodes.Name)
1143-
or node_frame_class(node) is None
1144-
# TODO: PY38: Use walrus operator, this will also fix the mypy issue
1145-
or node.args[0].name != node_frame_class(node).name # type: ignore[union-attr]
1140+
or (frame_class := node_frame_class(node)) is None
1141+
or node.args[0].name != frame_class.name
11461142
):
11471143
return
11481144

0 commit comments

Comments
 (0)