note the inclusion of the object class at the top of the hierarchy this is python built-in class from which every class is derivedwhether explicitly stated or not thusall of the classes defined earlier in the appendix were derived from the object class even though it was not indicated in the class definition inheritance allows us to reuse existing code without having to duplicate similar code after inheriting the properties of the parent classthe new child class can be tailored to specific purpose by adding new functionality or modifying the existing functionality of the parent class to add new functionalitythe child class can define new data attributes and methods while the functionality of existing methods can be overridden to provide new functionality as needed by the child deriving child classes to illustrate inheritancewe are going to define and implement the classes shown in figure which can be used to build bibliography the idea behind this example is that publication references can be created for each source cited in document and stored in list structure the collection of sources can then be printed at the end of the document to create the bibliography each class in our example will be used to store information related to specific type of bibliography entry every entry will contain at least three pieces of informationa unique user-defined string code for identifying specific entryand the title and author of the corresponding publication additional information will be maintained for each entrybut it varies depending on the type of entry we start with the publication base class used to store the minimum amount of information for each bibliography entryclass publication def __init__selfcodetitleauthor )self _code code self _title title self _author author gets the unique identification code for this entry def getcodeself )return self _code returns string containing formatted bibliography entry def getbibentryself )return '[self getcode('"self _title 'by self _author note the inclusion of the syntax object following the class name this tells python that the publication class is derived from the object class we could have omitted this explicit derivation as we did in the classes defined earlier in the appendixbut we included it for illustration of the default parent class in the publication classwe only define the three data fields that are common to the different types of bibliography entries the only information that we will need to obtain from each entry is the unique code valuewhich can be accessed using getcode()and string containing correctly formatted bibliography entry