Inherit from two base classes : Inheritance : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Inheritance »

 

Inherit from two base classes


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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Inheritance