since the wav class fails to implement the abstract attributesit is not possible to instantiate that class the class is still legal abstract classbut you' have to subclass it to actually do anything the ogg class supplies both attributesso it instantiates cleanly going back to the medialoader abclet' dissect that __subclasshook__ method it is basically saying that any class that supplies concrete implementations of all the abstract attributes of this abc should be considered subclass of medialoadereven if it doesn' actually inherit from the medialoader class more common object-oriented languages have clear separation between the interface and the implementation of class for examplesome languages provide an explicit interface keyword that allows us to define the methods that class must have without any implementation in such an environmentan abstract class is one that provides both an interface and concrete implementation of some but not all methods any class can explicitly state that it implements given interface python' abcs help to supply the functionality of interfaces without compromising on the benefits of duck typing demystifying the magic you can copy and paste the subclass code without understanding it if you want to make abstract classes that fulfill this particular contract we'll cover most of the unusual syntaxes throughout the bookbut let' go over it line by line to get an overview @classmethod this decorator marks the method as class method it essentially says that the method can be called on class instead of an instantiated objectdef __subclasshook__(clsc)this defines the __subclasshook__ class method this special method is called by the python interpreter to answer the questionis the class subclass of this classif cls is medialoaderwe check to see if the method was called specifically on this classrather thansay subclass of this class this preventsfor examplethe wav class from being thought of as parent class of the ogg classattrs set(dir( )