Commits

Sylvain Thénault committed e4e7f8f

avoid W0221 or W0222 when *args and **kwargs are in use. Patch by Charles Duffy.

  • Participants
  • Parent commits c2aa781

Comments (0)

Files changed (3)

 ChangeLog for PyLint
 ====================
 
-2010-12-16 -- 0.23.0
+ -- 
 
-   * documentation: update, add manpages
-   * performance: several improvements
-   * python3: finalize python3 support
+   * documentation update, add manpages
 
-   * W0106: new warning 'Expression "%s" is assigned to nothing'
+   * several performance improvements
+
+   * finalize python3 support
+
+   * new W0106 warning 'Expression "%s" is assigned to nothing'
 
    * drop E0501 and E0502 messages about wrong source encoding: not anymore
      interesting since it's a syntax error for python >= 2.5 and we now only
      support this python version and above.
 
+   * don't emit W0221 or W0222 when methods as variable arguments (eg *arg
+     and/or **args). Patch submitted by Charles Duffy.
 
 2010-11-15  --  0.22.0
 

checkers/classes.py

         # don't care about functions with unknown argument (builtins)
         if method1.args.args is None or refmethod.args.args is None:
             return
+        # if we use *args, **kwargs, skip the below checks
+        if method1.args.vararg or 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):

test/input/func_noerror_overriden_method_varargs.py

+# pylint: disable=R0201,R0903
+"""docstring"""
+
+__revision__ = 1
+
+class SuperClass(object):
+    """docstring"""
+    def impl(self, arg1, arg2):
+        """docstring"""
+        return arg1 + arg2
+
+class MyClass(SuperClass):
+    """docstring"""
+    def impl(self, *args, **kwargs):
+        """docstring"""
+        # ...do stuff here...
+        super(MyClass, self).impl(*args, **kwargs)
+
+# ...do stuff here...