def spam(self)return 'spammetaclass inherited by subs too metaone run twice for two classes class sub(super)def eggs(self)return 'eggssuperclassinheritance versus instance classes inherit from superclasses but not from metaclasses when this code is run (as script or module)the metaclass handles construction of both client classesand instances inherit class attributes but not metaclass attributesfrom metainstance import in metaone newsuper in metaone newsub runs class statementsmetaclass run twice sub(normal instance of user-defined class eggs(inherited from sub 'eggsx spam(inherited from super 'spamx toast(not inherited from metaclass attributeerror'subobject has no attribute 'toastby contrastclasses both inherit names from their superclassesand acquire names from their metaclass (which in this example is itself inherited from superclass)sub eggs(xown method 'eggssub spam(xinherited from super 'spamsub toast(acquired from metaclass 'toastsub toast(xnot normal class method typeerrortoast(takes positional argument but were given notice how the last of the preceding calls fails when we pass in an instancebecause the name resolves to metaclass methodnot normal class method in factboth the object you fetch name from and its source become crucial here methods acquired from metaclasses are bound to the subject classwhile methods from normal classes are unbound if fetched through the class but bound when fetched through the instancesub toast sub spam spam we've studied the last two of these rules before in ' bound method coveragethe first is newbut reminiscent of class methods to understand why this works the way it doeswe need to explore the metaclass instance relationship further metaclasses