Answer the question
In order to leave comments, you need to log in
How, when calling a method in a method of a child class, to pass an object of the parent class?
I'm new to Python OPP so don't judge too harshly. There is a situation:
class A()
class B(A)
class C(A)
I call a method of class C from class B and pass object B, but since class C is a child of class A, when calling a method of class B, pass object A. How being in a method of class B, call a method of class C passing an object of class A, which is the parent of B. How can this be done?
Answer the question
In order to leave comments, you need to log in
Well, you have porridge in ... understanding. Did you understand what you wrote?
At you inheritance contradicts the drawn diagram.
class A()
class B(A)
class C(A)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question