[Solved] Passing Object of SuperClass to the SubClass Constructor in Python


class super(object):
    def __init__(self, **kwargs):
        self.abc = kwargs.pop('abc', None)
        self.xyz = kwargs.pop('xyz', None)
        
    
    
        

class sub(super):
    def __init__(self, *args, **kwargs):
        super().__init__(**kwargs)
        self.pqr = kwargs.pop('pqr', None)
        self.sty = kwargs.pop('sty', None)
        self.contain = args[0]

    
    

obj_super = super(abc=1, xyz = 2)

obj_sub = sub(obj_super, pqr =3, sty=4)
print(obj_sub.contain.abc)

solved Passing Object of SuperClass to the SubClass Constructor in Python