def test_clrtype_metaclass_characteristics():
 class T(type, ):
  'This is our own type'
  def __clrtype__(self):
   return type.__clrtype__(self)
 class X(object, ):
  __metaclass__ = T
 AreEqual(X.__class__, T)
 AreEqual(X.__metaclass__, X.__class__)
 AreEqual(X.__class__.__base__, type)
 AreEqual(X.__class__.__bases__, (type,))
 AreEqual(X.__class__.__doc__, 'This is our own type')
 x = X()
 Assert(isinstance(x, X))
 Assert((not isinstance(x, T)))
 Assert((not issubclass(X, T)))
 AreEqual(x.__class__, X)
 AreEqual(x.__metaclass__, T)

def test_clrtype_metaclass_characteristics ( ) : class T ( type , ) : def __clrtype__ ( self ) : return type . __clrtype__ ( self ) class X ( object , ) : __metaclass__ = T AreEqual ( X . __class__ , T ) AreEqual ( X . __metaclass__ , X . __class__ ) AreEqual ( X . __class__ . __base__ , type ) AreEqual ( X . __class__ . __bases__ , ( type , ) ) AreEqual ( X . __class__ . __doc__ , 'This is our own type' ) x = X ( ) Assert ( isinstance ( x , X ) ) Assert ( ( not isinstance ( x , T ) ) ) Assert ( ( not issubclass ( X , T ) ) ) AreEqual ( x . __class__ , X ) AreEqual ( x . __metaclass__ , T )
make sure clrtype is a properly behaved python metaclass .