Skip to content

Commit 15850fd

Browse files
committed
Use _is_super helper.
1 parent cccaaf1 commit 15850fd

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

pylint/checkers/typecheck.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -1467,19 +1467,6 @@ def visit_call(self, node: nodes.Call) -> None:
14671467
"""Check that called functions/methods are inferred to callable objects,
14681468
and that passed arguments match the parameters in the inferred function.
14691469
"""
1470-
1471-
is_super = False
1472-
if (
1473-
isinstance(node.func, nodes.Attribute)
1474-
and node.func.attrname == "__init__"
1475-
and isinstance(node.func.expr, nodes.Call)
1476-
and isinstance(node.func.expr.func, nodes.Name)
1477-
and node.func.expr.func.name == "super"
1478-
):
1479-
inferred = safe_infer(node.func.expr)
1480-
if isinstance(inferred, astroid.objects.Super):
1481-
is_super = True
1482-
14831470
called = safe_infer(node.func, compare_constructors=True)
14841471

14851472
self._check_not_callable(node, called)
@@ -1501,7 +1488,7 @@ def visit_call(self, node: nodes.Call) -> None:
15011488
self._check_isinstance_args(node, callable_name)
15021489
# Built-in functions have no argument information, but we know
15031490
# super() only takes self.
1504-
if is_super and utils.is_builtin_object(called):
1491+
if self._is_super(node) and utils.is_builtin_object(called):
15051492
if (
15061493
(call_site := astroid.arguments.CallSite.from_call(node))
15071494
and call_site.positional_arguments

0 commit comments

Comments
 (0)