How do I create a decorator for an abstract class method in Python 2.7?
Yes, this is similar to this question, except I would like to combine abc.abstractmet
abc.abstractmet
You could upgrade to Python 3.
Starting with Python 3.3, it is possible to combine @classmethod and @abstractmethod:
@classmethod
@abstractmethod
import abc class Foo(abc.ABC): @classmethod @abc.abstractmethod def my_abstract_classmethod(...): pass
Thanks to @gerrit for pointing this out to me.