Option A is improper due to an inconsistent MRO (A is a base class of B but listed before it).
Option B is improper for the same reason as A (A is a base class of C but listed before it).
Option C is proper as it's a valid single inheritance from D.
Option D is proper as it's a valid multiple inheritance from C and B. The MRO is
Correct: C, D
#class Class_2(A,B): pass
#class Class_3(A,C): pass
class Class_1(D): pass
class Class_4(C,B): pass
#oa = Class2() #TypeError: Cannot create a consistent method resolution order (MRO) for bases A, B
#ob = Class_3() #TypeError: Cannot create a consistent method resolution order (MRO) for bases A, C
oc = Class_1()
od = Class_4()
print("ok")
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Abbribas
1 month, 2 weeks agoJeyTlenJey
1 year agoDave304409
1 year agokstr
1 year, 1 month agoDKAT2023
1 year, 1 month ago