I have a f1 function:
def f1(): return True
I also have a decorator that accepts arguments that can be used as follows:
@validate_arguments(arg1, arg2)
I try to call f1 manually without @ (for testing and reuse), but this does not work.
So something like:
validate_arguments(f1, arg1, arg2)
The reason this doesn't work is because validate_arguments is a function that takes arguments as parameters and contains a closure that is the actual decorator.
Is there no way to do what I want? To manually call a decorator on a function without @ , for a decorator that takes arguments?
python decorator
darksky
source share