49.diamond Shape Problem in Multiple Inheritance Python
49.diamond Shape Problem in Multiple Inheritance Python
From the start of this course, you may have noticed that I
am not just teaching you the syntax so that you may learn
just the practical approach to programming and could
create a few programs that have no real-world value.
Instead, I am trying to teach you all the theoretical and
practical concepts together so you may become a
successful programmer. You can do the programming by
just learning the syntax, but without proper conceptual
knowledge, you won't be able to develop proper logic
while writing code. Our today’s tutorial is also based on a
theoretical concept.
class A:
pass
class B(A):
pass
class C(A):
pass
class D( B, C ):
pass
As discussed earlier that it creates a priority related
confusion, so lets clear that out here.
class A:
def met(self):
print("This is a method from class A")
class B(A):
def met(self):
print("This is a method from class B")
class C(A):
def met(self):
print("This is a method from class C")
d.met()