I have a problem with the transfer of variable \'insurance_mode\' by the decorator. I would do it by the following decorator statement:
@execute_complete_rese
In case both the function and the decorator have to take arguments you can follow the below approach.
For example there is a decorator named decorator1
which takes an argument
@decorator1(5)
def func1(arg1, arg2):
print (arg1, arg2)
func1(1, 2)
Now if the decorator1
argument has to be dynamic, or passed while calling the function,
def func1(arg1, arg2):
print (arg1, arg2)
a = 1
b = 2
seconds = 10
decorator1(seconds)(func1)(a, b)
In the above code
seconds
is the argument for decorator1
a, b
are the arguments of func1