object-oriented programming name resolution and dynamic dispatch in the previous sectionwe discussed various namespacesand the mechanism for establishing entries in those namespaces in this sectionwe examine the process that is used when retrieving name in python' object-oriented framework when the dot operator syntax is used to access an existing membersuch as obj foothe python interpreter begins name resolution processdescribed as follows the instance namespace is searchedif the desired name is foundits associated value is used otherwise the class namespacefor the class to which the instance belongsis searchedif the name is foundits associated value is used if the name was not found in the immediate class namespacethe search continues upward through the inheritance hierarchychecking the class namespace for each ancestor (commonly by checking the superclass classthen its superclass classand so onthe first time the name is foundits associate value is used if the name has still not been foundan attributeerror is raised as tangible examplelet us assume that mycard identifies an instance of the predatorycreditcard class consider the following possible usage patterns mycard balance (or equivalentlyself balance from within method body)the balance method is found within the instance namespace for mycard mycard process month)the search begins in the instance namespacebut the name process month is not found in that namespace as resultthe predatorycreditcard class namespace is searchedin this casethe name is found and that method is called mycard make payment( )the search for the namemake paymentfails in the instance namespace and in the predatorycreditcard namespace the name is resolved in the namespace for superclass creditcard and thus the inherited method is called mycard charge( )the search for name charge fails in the instance namespace the next namespace checked is for the predatorycreditcard classbecause that is the true type of the instance there is definition for charge function in that classand so that is the one that is called in the last case shownnotice that the existence of charge function in the predatorycreditcard class has the effect of overriding the version of that function that exists in the creditcard namespace in traditional object-oriented terminologypython uses what is known as dynamic dispatch (or dynamic bindingto determineat run-timewhich implementation of function to call based upon the type of the object upon which it is invoked this is in contrast to some languages that use static dispatchingmaking compile-time decision as to which version of function to callbased upon the declared type of variable