I thought the following would work as a decorator
class D: def __init__(self, func): self.func = func def __call__(self, *args, **kwargs):