Virtual function in two base class : Class Virtual : Class : Python examples (example source code) Organized by topic

C++
PHP
Python


Python  »  Class   » [  Class Virtual  ]  Screenshots 
 



Virtual function in two base class





class Base1:
    def amethod(self)
       print "Base1"

class Base2(Base1): pass

class Base3:
    def amethod(self)
       print "Base3"

class Derived(Base2, Base3): pass

aninstance = Derived()

aninstance.amethod()

           
       
Related examples in the same category
1.  Override predefined function Override predefined function
2.  Virtual function: extend method behaviour Virtual function: extend method behaviour
3.  Virtual function in Python Virtual function in Python
4.  Virtual function in Python class Virtual function in Python class
5.  Virtual function in derived class is called Virtual function in derived class is called
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.