person giveraise(selfpercent bonusif __name__ ='__main__'bob person('bob smith'sue person('sue jones'job='dev'pay= print(bobprint(sueprint(bob lastname()sue lastname()sue giveraise print(suetom manager('tom jones''mgr' tom giveraise print(tom lastname()print(tomredefine at this level call person' version make manager__init__ runs custom version runs inherited method runs inherited __repr__ to test our manager subclass customizationwe've also added self-test code that makes managercalls its methodsand prints it when we make managerwe pass in nameand an optional job and pay as before--because manager had no __init__ constructorit inherits that in person here' the new version' output[personbob smith [personsue jones smith jones [personsue jones jones [persontom jones everything looks good herebob and sue are as beforeand when tom the manager is given raisehe really gets (his pay goes from $ to $ )because the customized giveraise in manager is run for him only also notice how printing tom as whole at the end of the test code displays the nice format defined in person' __repr__manager objects get thislastnameand the __init__ constructor method' code "for freefrom personby inheritance what about superto extend inherited methodsthe examples in this simply call the original through the superclass nameperson giveraisethis is the traditional and simplest scheme in pythonand the one used in most of this book java programmers may especially be interested to know that python also has super built-in function that allows calling back to superclass' methods more generically-but it' cumbersome to use in xdiffers in form between and xrelies on unusual semantics in xworks unevenly with python' operator overloadingand does not always mesh well with traditionally coded multiple inheritancewhere single superclass call won' suffice in its defensethe super call has valid use case too--cooperative same-named method dispatch in multiple inheritance trees--but it relies on the "mroordering of classeswhich many find esoteric and artificialunrealistically assumes universal deployment to be used reliablydoes not fully support method replacement and varying argument step customizing behavior by subclassing