def test_mro_bases():
 class C(object, ):
  def __getattribute__(self, name):
   if (name == 'xyz'):
    return 'C'
   return super(C, self).__getattribute__(name)
 class C1(C, ):
  def __getattribute__(self, name):
   if (name == 'xyz'):
    return 'C1'
   return super(C1, self).__getattribute__(name)
 class A(object, ):
  pass
 class B(object, ):
  def __getattribute__(self, name):
   if (name == 'xyz'):
    return 'B'
   return super(B, self).__getattribute__(name)
 a = C1()
 AreEqual(a.xyz, 'C1')
 C1.__bases__ = (A, B)
 AreEqual(a.xyz, 'C1')
 del C1.__getattribute__
 AreEqual(a.xyz, 'B')

def test_mro_bases ( ) : class C ( object , ) : def __getattribute__ ( self , name ) : if ( name == 'xyz' ) : return 'C' return super ( C , self ) . __getattribute__ ( name ) class C1 ( C , ) : def __getattribute__ ( self , name ) : if ( name == 'xyz' ) : return 'C1' return super ( C1 , self ) . __getattribute__ ( name ) class A ( object , ) : pass class B ( object , ) : def __getattribute__ ( self , name ) : if ( name == 'xyz' ) : return 'B' return super ( B , self ) . __getattribute__ ( name ) a = C1 ( ) AreEqual ( a . xyz , 'C1' ) C1 . __bases__ = ( A , B ) AreEqual ( a . xyz , 'C1' ) del C1 . __getattribute__ AreEqual ( a . xyz , 'B' )
verify replacing base classes also updates mro .