summaryrefslogtreecommitdiff
path: root/checkers/classes.py
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2014-08-16 00:25:57 +0300
committercpopa <devnull@localhost>2014-08-16 00:25:57 +0300
commit91af7c933718f518c819fd9eb9f3aa3dd967f43b (patch)
tree10fc0033740d0676c9e2d5c7f0e9ba4fd5a50eae /checkers/classes.py
parent5550b7e0257017b375f9a3cfad68f9cb2ad435a2 (diff)
downloadpylint-91af7c933718f518c819fd9eb9f3aa3dd967f43b.tar.gz
Detect calls of the parent's __init__, through a binded super() call.
Diffstat (limited to 'checkers/classes.py')
-rw-r--r--checkers/classes.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/checkers/classes.py b/checkers/classes.py
index ebca3f2..d9ebd8d 100644
--- a/checkers/classes.py
+++ b/checkers/classes.py
@@ -818,6 +818,17 @@ a metaclass class method.'}
klass = expr.expr.infer().next()
if klass is YES:
continue
+ # The infered klass can be super(), which was
+ # assigned to a variable and the `__init__` was called later.
+ #
+ # base = super()
+ # base.__init__(...)
+
+ if (isinstance(klass, astroid.Instance) and
+ isinstance(klass._proxied, astroid.Class) and
+ is_builtin_object(klass._proxied) and
+ klass._proxied.name == 'super'):
+ return
try:
del not_called_yet[klass]
except KeyError: