In Python 2.x when you want to mark a method as abstract, you can define it like so:
class Base:
def foo(self):
raise NotImplementedError(\"Subcl
Here is a simple example how to set required properties/methods for sublasses in Python 3.
class Base:
requires = ('foo', 'bar')
def __init_subclass__(cls, **kwargs):
for requirement in cls.requires:
if not hasattr(cls, requirement):
raise NotImplementedError(
f'"{cls.__name__}" must have "{requirement}".')
super().__init_subclass__(**kwargs)