4 ms·
In your own code you can just wrap argument-less decorators in a function. def decorator(): return some_library.decorator_with_no_args @decorato
by jamii 15y ago
In your own code you can just wrap argument-less decorators in a function.
def decorator():
return some_library.decorator_with_no_args
@decorator()
- jackowayed 15y agoBut then @decorator doesn't work. I guess if I did that for every single decorator I use, I would at least have consistency. But that's not a very satisfying solution even ignoring the fact that now I have to wrap every zero-arg decorator I want to use.