def test_mixed_newstyle_oldstyle_init():
 class foo:
  def __init__(self):
   self.x = 3
 class bar(foo, ):
  def __init__(self):
   self.x = 4
 class baz(foo, ):
  pass
 class ns(object, ):
  pass
 class full(bar, baz, ns, ):
  pass
 a = full()
 AreEqual(a.x, 4)
 class full(bar, baz, ns, ):
  def __init__(self):
   self.x = 5
 a = full()
 AreEqual(a.x, 5)
 class ns(object, ):
  def __init__(self):
   self.x = 6
 class full(bar, baz, ns, ):
  pass
 a = full()
 AreEqual(a.x, 4)

def test_mixed_newstyle_oldstyle_init ( ) : class foo : def __init__ ( self ) : self . x = 3 class bar ( foo , ) : def __init__ ( self ) : self . x = 4 class baz ( foo , ) : pass class ns ( object , ) : pass class full ( bar , baz , ns , ) : pass a = full ( ) AreEqual ( a . x , 4 ) class full ( bar , baz , ns , ) : def __init__ ( self ) : self . x = 5 a = full ( ) AreEqual ( a . x , 5 ) class ns ( object , ) : def __init__ ( self ) : self . x = 6 class full ( bar , baz , ns , ) : pass a = full ( ) AreEqual ( a . x , 4 )
mixed new-style & old-style class should run init if its defined in the old-style class .