Can a method be a decorator of another method of the same class? Can a method be a decorator of another method of the same class? python python

Can a method be a decorator of another method of the same class?


The decorator gets only one parameter – the function or method it decorates. It does not get passed an instance as self parameter – at the moment the decorator is called, not even the class has been created, let alone an instance of the class. The instance will be passed as first argument to the decorated function, so you should include self as first parameter in the parameter list of call().

I don't see the necessity to include the decorator in the class scope. You can do this, but you can just as well have it at module scope.