diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-06-15 14:53:03 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-06-15 14:53:03 +0300 |
commit | 83eef8c5cf1dc2cd47e580e4b1d5ec6eaffb212b (patch) | |
tree | 35987b3b68546e6893838d1560481f93d81432e2 /pylint/checkers/typecheck.py | |
parent | 5087ff53bfd20639de0265a4d21ff11422c79296 (diff) | |
download | pylint-83eef8c5cf1dc2cd47e580e4b1d5ec6eaffb212b.tar.gz |
Fix a false positive regarding staticmethods: they don't have an implicit argument when 'bounded'.
Diffstat (limited to 'pylint/checkers/typecheck.py')
-rw-r--r-- | pylint/checkers/typecheck.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index 5dd3ff9..abe27f1 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -164,7 +164,13 @@ def _determine_callable(callable_obj): # and Function inherits Lambda. if isinstance(callable_obj, astroid.BoundMethod): # Bound methods have an extra implicit 'self' argument. - return callable_obj, 1, callable_obj.type + extra_args = 1 + if callable_obj.type == 'staticmethod': + # Static methods are bounded when they're called from + # a super call. In this case, they don't have an + # implicit argument (self). + extra_args = 0 + return callable_obj, extra_args, callable_obj.type elif isinstance(callable_obj, astroid.UnboundMethod): return callable_obj, 0, 'unbound method' elif isinstance(callable_obj, astroid.Function): |