operators( age name attributeerrorname runs __getattr__ runs __getattr__ here is the same examplecoded with properties insteadnote that properties are available for all classes but require the new-style object derivation in to work properly for intercepting attribute assignments (and won' complain if you forget this--but will silently overwrite your property with the new data!)class properties(object)need object in for setters def getage(self)return age property(getagenonenonenone(getsetdeldocs)or use properties( age runs getage name normal fetch attributeerror'propertiesobject has no attribute 'namefor some coding tasksproperties can be less complex and quicker to run than the traditional techniques for examplewhen we add attribute assignment supportproperties become more attractive--there' less code to typeand no extra method calls are incurred for assignments to attributes we don' wish to compute dynamicallyclass properties(object)need object in for setters def getage(self)return def setage(selfvalue)print('set age%svalueself _age value age property(getagesetagenonenonex properties( age age set age _age age job 'trainerx job 'trainerruns getage runs setage normal fetchno getage call runs getage normal assignno setage call normal fetchno getage call the equivalent class based on operator overloading incurs extra method calls for assignments to attributes not being managed and needs to route attribute assignments through the attribute dictionary to avoid loops (orfor new-style classesto the new-style class extensions