Skip to content

Commit 040573c

Browse files
committed
Fix check unused arguments false positive bug
One of the check for unused arguments looks for unused arguments in `__new`. Problem, `__new__` have to match the arguments of `__init__` even if it does not use them. This behavior was introduced in the following commit: pylint-dev@ebb64fc. There is no details on why `__new__` has been added to the list. As it's done for special methods with fixed number of parameters, there should not be unused arguments check for `__new__`, I removed it from the tested values. Fixes pylint-dev#3670
1 parent 82cee37 commit 040573c

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

pylint/checkers/variables.py

-1
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,6 @@ def _check_unused_arguments(
26922692
return
26932693
if node.name in utils.PYMETHODS and node.name not in (
26942694
"__init__",
2695-
"__new__",
26962695
):
26972696
return
26982697
# Don't check callback arguments

0 commit comments

Comments
 (0)