BackgroundI have a base (only 2 classes inherit from it, and only from it) abstract (meaning I don't want it to be used directly) class that implements some common functionality.Some of it depends on certain methods being defined, methods whose implementation differs per the exact sub-class; so I set-up a mechanism to raise an exception in case that kind of thing happened (better explicit fail than subtle debugging, right?).Codeclass Matrix:    Model an abstract base interface for 2-d matrices.    def __init__(self):        Raise error as class is abstract.        self.__eq__ = self._flip = self._rotate = self.__error        raise NotImplementedError({} should not be instantiated directly.format(type(self)))    def __error(self):        Raise error as certain methods need to be over-rided.        raise NotImplementedError(method needs to be defined by sub-class)QuestionIs that an anti-pattern, like singletons or w/e? If so, what's a better way? Should I even check for this at all (i.e., maybe similar to excessive type-checking)?Disclaimer: Python was my first language, and I do NOT like Java (although I have some experience from Android development); so this is not me trying to port some ruddy static pattern from another language.
Raising error if method not overridden by sub-class
python;classes;inheritance;abstract factory
Source: Question answered while rubber-ducking in the chat-room, LOL ;)When the Matrix methods try to look for the non-existent methods; they'll error out  naturally  as a NameError.Note Although there are other great, detailed answers here about idiomatic use of abstract classes, what I eventually went with was just removing the methods; so  I think I should accept my answer as per the FAQ and +1 the rest of the useful ones.