@@ -29,7 +29,7 @@ def __init__(self):
29
29
class Py3kWrongSuper (Py3kAaaa ):
30
30
"""new style"""
31
31
def __init__ (self ):
32
- super (NewAaaa , self ).__init__ () # [bad-super-call]
32
+ super (NewAaaa , self ).__init__ ()
33
33
34
34
class WrongNameRegression (Py3kAaaa ):
35
35
""" test a regression with the message """
@@ -59,7 +59,7 @@ class FalsePositive(Empty):
59
59
"""The following super is in another scope than `test`."""
60
60
def __init__ (self , arg ):
61
61
super (FalsePositive , self ).__init__ (arg )
62
- super (object , 1 ).__init__ () # [bad-super-call]
62
+ super (object , 1 ).__init__ ()
63
63
64
64
65
65
class UnknownBases (Missing ):
@@ -123,3 +123,34 @@ class SuperWithSelfClass(object):
123
123
"""self.__class__ may lead to recursion loop in derived classes"""
124
124
def __init__ (self ):
125
125
super (self .__class__ , self ).__init__ () # [bad-super-call]
126
+
127
+
128
+ # Reported in https://github.com/PyCQA/pylint/issues/2903
129
+ class Parent :
130
+ def method (self ):
131
+ print ()
132
+
133
+
134
+ class Child (Parent ):
135
+ def method (self ):
136
+ print ("Child" )
137
+ super ().method ()
138
+
139
+ class Niece (Parent ):
140
+ def method (self ):
141
+ print ("Niece" )
142
+ super ().method ()
143
+
144
+ class GrandChild (Child ):
145
+ def method (self ):
146
+ print ("Grandchild" )
147
+ super (GrandChild , self ).method ()
148
+ super (Child , self ).method ()
149
+ super (Niece , self ).method () # [bad-super-call]
150
+
151
+
152
+ # Reported in https://github.com/PyCQA/pylint/issues/4922
153
+ class AlabamaCousin (Child , Niece ):
154
+ def method (self ):
155
+ print ("AlabamaCousin" )
156
+ super (Child , self ).method ()
0 commit comments