Home

Hi,

I want to write a flexible decorators to edit a function that may have
1 or more arguments...

def enhance(func):
def new(x):
#do something ...
return func(x)
return new

@enhance
def method_a(x):
#do something ...

While the enhance decorator work with functions of 1 argument, how do
I make it to work with more than one arguments.

Thanks
james

previous
next

Re: Iterator to last element in list?
Re: So what exactly is a complex number?
Entering strings as user input but interpreting as Python input (sortof)
Re: Addressing a &vector<>[i] as a C-array & the C++ standard.
Re: find difference in days from YYYYMMDD to YYYYMMDD
Kidprotect
Nasze Dzieci
Fundacja Hobbit
Pajacyk
Dzieci Niczyje