fixed PY-3055 Missing super constructor call Inspection

This commit is contained in:
Ekaterina Tuzova
2011-03-10 21:09:09 +03:00
parent d1a130f871
commit 7e17a7dd2a
5 changed files with 163 additions and 0 deletions
@@ -0,0 +1,38 @@
class A(object):
def __init__(self):
pass
class AA(A):
def __init__(self):
A.__init__(self)
print("Constructor AA was called")
class B(A):
def <warning descr="Call to constructor of super class is missed">__init__</warning>(self):
print("Constructor B was called")
class C(B):
def __init__(self):
super(C, self).__init__()
print("Constructor C was called")
class A:
def __init__(self):
print("A __init__")
class B(A):
def __init__(self):
A.__init__(self)
print("Constructor B was called")
class C(B):
def <warning descr="Call to constructor of super class is missed">__init__</warning>(self):
print("Constructor C was called")
class D(A):
def __init__(self):
if True:
A.__init__(self)
print("Constructor D was called")