fork(1) download
  1. class MyType(type): pass
  2.  
  3. class SubType(MyType): pass
  4.  
  5. class MyObject(object):
  6. __metaclass__ = MyType
  7.  
  8. print("MyType.__class__ = %s" % (MyType.__class__))
  9. print("SubType.__class__ = %s" % (SubType.__class__))
  10. print("MyObject.__class__ = %s" % (MyObject.__class__))
Success #stdin #stdout 0.05s 9648KB
stdin
Standard input is empty
stdout
MyType.__class__ = <class 'type'>
SubType.__class__ = <class 'type'>
MyObject.__class__ = <class 'type'>