print('-'* sue person('sue jones'print(sue nameprint(person name __doc__runs delname sue inherits property too or help(person nameproperties are available in both and xbut they require new-style object derivation in to work correctly for assignments--add object as superclass here to run this in you can list the superclass in toobut it' implied and not requiredand is sometimes omitted in this book to reduce clutter this particular property doesn' do much--it simply intercepts and traces an attribute --but it serves to demonstrate the protocol when this code is runtwo instances inherit the propertyjust as they would any other attribute attached to their class howevertheir attribute accesses are caughtc:\codepy - prop-person py fetch bob smith change fetch robert smith remove fetch sue jones name property docs like all class attributesproperties are inherited by both instances and lower subclasses if we change our example as followsfor instanceclass superthe original person class code name property(getnamesetnamedelname'name property docs'class person(super)pass properties are inherited (class attrsbob person('bob smith'rest unchanged the output is the same--the person subclass inherits the name property from superand the bob instance gets it from person in terms of inheritanceproperties work the same as normal methodsbecause they have access to the self instance argumentthey can access instance state information and methods irrespective of subclass depthas the next section further demonstrates properties