Ksenia Marasanova wrote: > class BasemethodMeta(type): > def __new__(cls, class_name, bases, new_attrs): > cls = type.__new__(cls, class_name, bases, new_attrs) > new_attrs['__metaclass__'].cls = cls > return cls > > def __call__(self): > return self.cls.get_foo()
Though I'm not sure what you are trying to do, I fear it will get more complicated than necessary. But you do get the desired output if you change your metaclass to class BasemethodMeta(type): def __call__(cls): # the instance of the metaclass already is a class # so you can drop the double indirection return cls.get_foo() Peter -- http://mail.python.org/mailman/listinfo/python-list