The definition arg_cacheshould be something like:
def arg_cache(cthis, cthat, cthisandthat):
def f(obj):
obj.cache_this = cthis
obj.cache_that = cthat
obj.thisandthat = cthisandthat
return obj
return f
@arg_cache(cache_this, cache_that, cache_this_and_that)
...
The example assumes that you just want to set some properties in the decorated class. Of course, you could do something else with three parameters.
source
share