inheritance it is possible to create new class that modifies the behavior of an existing class through inheritance this is done by passing the inherited class as an argument in the class definition it is often used to modify the behavior of existing methodsfor exampleclass specialemployee(employee)def hours(selfnumhours)self owed +numhours self rate return(" hours workednumhoursan instance of the specialemployee class is identical to an employee instance except for the changed hours(method for subclass to define new class variablesit needs to define an __init__(methodas followsclass specialemployee(employee)def __init__(self,name,ratebonus)employee __init__(selfnamerate#calls the base classes self bonus bonus def hours(selfnumhours)self owed +numhours self rate self bonus return(" hours workednumhoursnotice that the methods of the base class are not automatically invoked and it is necessary for the derived class to call them we can test for class membership using the built-in function isintance(obj obj this returns true if obj belongs to the class of obj or any class derived from obj within class definitionit is assumed that all methods operate on the instancebut this is not requirement there arehoweverother types of methodsstatic methods and class methods static method is just an ordinary function that just happens to be defined in class it does not perform any operations on the instance and it is defined using the @staticmethod class decorator static methods cannot access the attributes of an instanceso their most common usage is as convenience to group utility functions together