2005/9/9, Peter Otten <[EMAIL PROTECTED]>: > 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 > > returncls > > > > def__call__(self): > > returnself.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 >
Man.. that's easy. Thanks a lot, Peter. -- Ksenia -- http://mail.python.org/mailman/listinfo/python-list