#!/usr/local/bin/python2 class M(type): def __init__(self, name, bases, attrs): #self.i = 1 self.d() def d(self): print self.__class__ class C(object): __metaclass__ = M print C.i