Inherit from two base classes : Inheritance « Class « Python Tutorial






class Calculator:
    def calculate(self, expression):
        self.value = eval(expression)

class Talker:
    def talk(self):
        print 'Hi, my value is', self.value

class TalkingCalculator(Calculator, Talker):
    pass








11.11.Inheritance
11.11.1.Inherit from two base classes
11.11.2.OOP and Inheritance: "Is-a" Relationships
11.11.3.Specializing Inherited Methods
11.11.4.Classes Are Customized by Inheritance