class Controller(object):

    def __new__(cls, *args, **kargs):
        if not hasattr(cls, 'path'):
            raise NotImplementedError(
                "'Controller' subclasses should have a 'path' attribute")
return object.__new__(cls, *args, **kargs)


class C1(Controller):
    path = 42


class C2(Controller):
    pass
Abstract attributes in Python