Quantcast
Channel: `staticmethod` and `abc.abstractmethod`: Will it blend? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Nick for `staticmethod` and `abc.abstractmethod`: Will it blend?

$
0
0

This is currently not possible in Python 2.X, which will only enforce the method to be abstract or static, but not both.

In Python 3.2+, the new decoratorsabc.abstractclassmethod and abc.abstractstaticmethod were added to combine their enforcement of being abstract and static or abstract and a class method.

See Python Issue 5867


Viewing all articles
Browse latest Browse all 6

Trending Articles