Decorators on abstract methods
问题 In python, is there a way to make a decorator on an abstract method carry through to the derived implementation(s)? For example, in import abc class Foo(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod @some_decorator def my_method(self, x): pass class SubFoo(Foo): def my_method(self, x): print x SubFoo 's my_method won't get decorated with some_decorator as far as I can tell. Is there some way I can make this happen without having to individually decorate each derived class of Foo ?