virtual function appears in two bases

joe Li joehust at gmail.com
Fri Oct 27 07:47:15 EDT 2006


I saw the following code, but I don't understand the rule for virtual
function that appears in two bases
Could anyone explain it for me, thanks.

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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061027/17f0f30c/attachment.html>


More information about the Python-list mailing list