pylint #52023 spurious W0221, W0222 with *args, **kwargs [resolved]

W0221 and W0222 report cases when the argument list between a method and its parent have a differing number of elements; however, it has no exception for cases where varargs and/or kwargs are in use.

This causes a method as follows:

class MyClass(SuperClass):
def impl(*args, **kwargs):
# stuff here...
super(MyClass, self).impl(*args, **kwargs)
# stuff here...

to potentially throw such a warning.

In my local branch of pylint, I have the following patch applied:

changeset: 712:da7205e3e376
tag: tip
user: Charles Duffy <>
date: Wed Dec 08 10:53:59 2010 -0600
summary: avoid W0221 or W0222 when *args and **kwargs are in use

diff -r 5a1dea9de7b2 -r da7205e3e376 checkers/
--- a/checkers/ Wed Dec 08 10:38:22 2010 +0100
+++ b/checkers/ Wed Dec 08 10:53:59 2010 -0600
@@ -493,6 +493,9 @@
# don't care about functions with unknown argument (builtins)
if method1.args.args is None or refmethod.args.args is None:
+ # if we use *args, **kwargs, skip the below checks
+ if method1.args.vararg and method1.args.kwarg:
+ return
if len(method1.args.args) != len(refmethod.args.args):
self.add_message('W0221', args=class_type, node=method1)
elif len(method1.args.defaults) < len(refmethod.args.defaults):

appeared in<not specified>
done in0.23.0
load left0.000
closed by<not specified>