decorating base methods

2008-08-13 Thread Alexandru Mosoi
I want to derive a base class, such that some methods are decorated. The only thing I have in mind is: class Base(object): def A(self, x): pass def B(self, y): pass class Derived(Base): @decorator def A(self, x): Base.A(self, x) Is this correct approach? How can avoid call to

Re: decorating base methods

2008-08-13 Thread Duncan Booth
Alexandru Mosoi [EMAIL PROTECTED] wrote: I want to derive a base class, such that some methods are decorated. The only thing I have in mind is: class Base(object): def A(self, x): pass def B(self, y): pass class Derived(Base): @decorator def A(self, x): Base.A(self, x)