__dict__['age'keyerror'agebut attribute fetch checks classes too indexing dict does not do inheritance to facilitate inheritance search on attribute fetcheseach instance has link to its class that python creates for us--it' called __class__if you want to inspect itx __class__ instance to class link classes also have __bases__ attributewhich is tuple of references to their superclass objects--in this example just the implied object root class in python we'll explore later (you'll get an empty tuple in instead)rec __bases__ (,class to superclasses link(in these two attributes are how class trees are literally represented in memory by python internal details like these are not required knowledge--class trees are implied by the code you runand their search is normally automatic--but they can often help demystify the model the main point to take away from this look under the hood is that python' class model is extremely dynamic classes and instances are just namespace objectswith attributes created on the fly by assignment those assignments usually happen within the class statements you codebut they can occur anywhere you have reference to one of the objects in the tree even methodsnormally created by def nested in classcan be created completely independently of any class object the followingfor exampledefines simple function outside of any class that takes one argumentdef uppername(obj)return obj name upper(still needs self argument (objthere is nothing about class here yet--it' simple functionand it can be called as such at this pointprovided we pass in an object obj with name attributewhose value in turn has an upper method--our class instances happen to fit the expected interfaceand kick off string uppercase conversionuppername( 'suecall as simple function if we assign this simple function to an attribute of our classthoughit becomes methodcallable through any instanceas well as through the class name itself as long as we pass in an instance manually-- technique we'll leverage further in the next rec method uppername now it' class' methodx method('suerun method to process the world' simplest python class