On 2 Feb 2006 12:08:43 -0800, [EMAIL PROTECTED] wrote: >Hi, > >I'm trying to write a method that needs to know both the class name and >the instance details > >class A: > > @classmethod > def meth(cls, self): > print cls > print self > >a = A() >a.meth(a) > >The above code seems to work as intended. Could the same effect be >achieved using a second decorator in addition to the @classmethod. I >tried > > def instancemethod(self): > return self.meth(self) > > @instancemethod > @classmethod > def meth(cls, self): > #do stuff > >but it didn't work. Any suggestions?
Hint: decorators usually return functions. What does your decorator return? Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list