I have 3 classes.
Class A:
def __init__(self,a1,a2,a3)
self.a1 = 10
self.a2 = B()
self.a3 =20
Class B:
def __init__(self,b1,b2,b3)
self.b1 = C()
self.b2 = 30
self.b3 = 40
Class C:
def __init__(self,c1,c2,c3):
self.c1 = 50
self.c2 = 60
self.c3 = 70
input = [object A at xxx]
I want to get all details in objects as output.
output should be [{a1:10,a2:{b1: {c1:50, c2:60, c3: 70}, b2:30, b3:40}, a3: 20}]
I tried this way, but it is hectic job.
for each in input[0].__dict__:
for x in each.__dict__:
Any solution? Off course- Without "ValueError: Circular reference detected".