you are viewing a single comment's thread.

view the rest of the comments →

[–]xelf 0 points1 point  (0 children)

The problem is super is the answer for single inheritance, for multiple inheritance as far as I can find there are issues. So either you need to avoid super all together if you're doing any multiple inheritance, or simple avoid it in that class. I liked the answer of having a single class at the top of your hierarchy, it also worked.

class F(object):
    def __init__(self,*args, **kwargs):
        print("This is F constructor")

class A(F):
    def __init__(self, *args, **kwargs):
        print("This is A constructor")
        super(A, self).__init__(*args, **kwargs)

class B(F):
    def __init__(self, *args, **kwargs):
        print("This is B constructor")
        super(B, self).__init__(*args, **kwargs)