Re: Inheriting and modifying lots of methods

2009-10-27 Thread Steven D'Aprano
On Tue, 27 Oct 2009 10:43:42 -0700, Felipe Ochoa wrote: > I need to create a subclass from a parent class that has lots of > methods, and need to decorate all of these. Is there pythonic way of > doing this other than: > > def myDecorator (meth): > @wraps(meth) > def newMeth (*args, **kw)

Re: Inheriting and modifying lots of methods

2009-10-27 Thread Diez B. Roggisch
Felipe Ochoa wrote: > I need to create a subclass from a parent class that has lots of > methods, and need to decorate all of these. Is there pythonic way of > doing this other than: > > def myDecorator (meth): > @wraps(meth) > def newMeth (*args, **kw): > print("Changing some arg

Inheriting and modifying lots of methods

2009-10-27 Thread Felipe Ochoa
I need to create a subclass from a parent class that has lots of methods, and need to decorate all of these. Is there pythonic way of doing this other than: def myDecorator (meth): @wraps(meth) def newMeth (*args, **kw): print("Changing some arguments here.") return meth(ne