class MyMeta(type): def __str__(cls): return "Class name is '%s'"%cls.__name__class MyClass: __metaclass__ = MyMetax = MyClass()print type(x)