serhii.net

In the middle of the desert you can say anything you want

27 Sep 2022

Python blending abstractmethod and staticmethod (or other decorators)

If your @abstractmethod should also be a @staticmethod, you can happily blend both, as long as the @staticmethod (or other) decorator comes first.

In other words, @abstractmethod should always be the innermost decorator.1


  1. abc — Abstract Base Classes — Python 3.10.7 documentation↩︎

Nel mezzo del deserto posso dire tutto quello che voglio.