tederror exception directly in such method stubs to signal the mistakeclass superdef delegate(self)self action(def action(self)raise notimplementederror('action must be defined!' super( delegate(notimplementederroraction must be definedfor instances of subclasseswe still get the exception unless the subclass provides the expected method to replace the default in the superclassclass sub(super)pass sub( delegate(notimplementederroraction must be definedclass sub(super)def action(self)print('spam' sub( delegate(spam for somewhat more realistic example of this section' concepts in actionsee the "zoo animal hierarchyexercise (exercise at the end of and its solution in "part viclasses and oopin appendix such taxonomies are traditional way to introduce oopbut they're bit removed from most developersjob descriptions (with apologies to any readers who happen to work at the zoo!abstract superclasses in python and +preview as of python and the prior section' abstract superclasses ( "abstract base classes")which require methods to be filled in by subclassesmay also be implemented with special class syntax the way we code this varies slightly depending on the version in python xwe use keyword argument in class headeralong with special decorator syntaxboth of which we'll study in detail later in this bookfrom abc import abcmetaabstractmethod class super(metaclass=abcmeta)@abstractmethod def method(self)pass but in python and we use class attribute instead class coding details