Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Liquid Web Managed Dedicated Server: RAID 1 SSD with 16GB of RAM minimum! 24/7 On-Site Heroic Support! Industry-Leading SLA!

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Liquid Web Cloud VPS Hosting

8,548 questions

11,834 answers

573 users

How to use multiple inheritance in Python

5 Answers

0 votes
class A:
    def m(self):
        print("class A: m(self)")


class B(A):
    pass


class C(A):
    def m(self):
        print("class C(A): m(self)")


class D(B, C):
    pass


ao = A()
ao.m()


'''
run:

class A: m(self)

'''

 




answered Feb 12 by avibootz
0 votes
class A:
    def m(self):
        print("class A: m(self)")
 
 
class B(A):
    pass
 
 
class C(A):
    def m(self):
        print("class C(A): m(self)")
 
 
class D(B, C):
    pass
 
 
bo = B()
bo.m()
 
 
'''
run:
 
class A: m(self)
 
'''

 




answered Feb 12 by avibootz
0 votes
class A:
    def m(self):
        print("class A: m(self)")
 
 
class B(A):
    pass
 
 
class C(A):
    def m(self):
        print("class C(A): m(self)")
 
 
class D(B, C):
    pass
 
 
co = C()
co.m()
 
 
'''
run:
 
class C(A): m(self)
 
'''

 




answered Feb 12 by avibootz
0 votes
class A:
    def m(self):
        print("class A: m(self)")
 
 
class B(A):
    pass
 
 
class C(A):
    def m(self):
        print("class C(A): m(self)")
 
 
class D(B, C):
    pass
 
 
do = D()
do.m()
 
 
'''
run:
 
class C(A): m(self)
 
'''

 




answered Feb 12 by avibootz
0 votes
class A:
    def m(self):
        print("class A: m(self)")
 
 
class B(A):
    def m(self):
        print("class B(A): m(self)")
 
 
class C(A):
    def m(self):
        print("class C(A): m(self)")
 
 
class D(B, C):
    def m(self):
        print("class D(B, C): m(self)")


ao = A()
ao.m()

bo = B()
bo.m()

co = C()
co.m()

do = D()
do.m()
 
 
'''
run:
 
class A: m(self)
class B(A): m(self)
class C(A): m(self)
class D(B, C): m(self)
 
'''

 




answered Feb 12 by avibootz
...