Explanation of a decorator class in python
问题 While reading up about some python module I encountered this decorator class: # this decorator lets me use methods as both static and instance methods class omnimethod(object): def __init__(self, func): self.func = func def __get__(self, instance, owner): return functools.partial(self.func, instance) What I know about decorators, is that the can extend functionality (e.g. for a function). Could someone be so kind and explain to me why the class above is useful and how it exactly works ? It is