pass @classmethod def __subclasshook__(clsc)if cls is medialoaderattrs set(dir( )if set(cls __abstractmethods__<attrsreturn true return notimplemented this is complicated example that includes several python features that won' be explained until later in this book it is included here for completenessbut you don' need to understand all of it to get the gist of how to create your own abc the first weird thing is the metaclass keyword argument that is passed into the class where you would normally see the list of parent classes this is rarely used construct from the mystic art of metaclass programming we won' be covering metaclasses in this bookso all you need to know is that by assigning the abcmeta metaclassyou are giving your class superpower (or at least superclassabilities nextwe see the @abc abstractmethod and @abc abstractproperty constructs these are python decorators we'll discuss those in when to use object-oriented programming for nowjust know that by marking method or property as being abstractyou are stating that any subclass of this class must implement that method or supply that property in order to be considered proper member of the class see what happens if you implement subclasses that do or don' supply those propertiesclass wav(medialoader)pass wav(traceback (most recent call last)file ""line in typeerrorcan' instantiate abstract class wav with abstract methods extplay class ogg(medialoader)ext oggdef play(self)pass ogg(