header the net result is tree of attribute namespaces that leads from an instanceto the class it was generated fromto all the superclasses listed in the class header python searches upward in this treefrom instances to superclasseseach time you use qualification to fetch an attribute name from an instance object figure - program code creates tree of objects in memory to be searched by attribute inheritance calling class creates new instance that remembers its classrunning class statement creates new classand superclasses are listed in parentheses in the class statement header each attribute reference triggers new bottom-up tree search--even references to self attributes within class' methods specializing inherited methods the tree-searching model of inheritance just described turns out to be great way to specialize systems because inheritance finds names in subclasses before it checks superclassessubclasses can replace default behavior by redefining their superclasses two fine points herefirstthis description isn' completebecause we can also create instance and class attributes by assigning them to objects outside class statements--but that' much less common and sometimes more error-prone approach (changes aren' isolated to class statementsin pythonall attributes are always accessible by default we'll talk more about attribute name privacy in when we study __setattr__in when we meet __x namesand again in where we'll implement it with class decorator secondas also noted in the full inheritance story grows more convoluted when advanced topics such as metaclasses and descriptors are added to the mix--and we're deferring formal definition until for this reason in common usagethoughit' simply way to redefineand hence customizebehavior coded in classes class coding details