class Test():
def __init__(self):
self.a = 1
self.b = 2
class FooTest():
def __init__(self, struct):
for k in struct.__dict__.keys():
setattr(self, k, getattr(struct, k))
f = FooTest(Test())
print(f.a, f.b)
Y2xhc3MgVGVzdCgpOgogICAgZGVmIF9faW5pdF9fKHNlbGYpOgogICAgICAgIHNlbGYuYSA9IDEKICAgICAgICBzZWxmLmIgPSAyCgpjbGFzcyBGb29UZXN0KCk6CiAgICBkZWYgX19pbml0X18oc2VsZiwgc3RydWN0KToKICAgICAgICBmb3IgayBpbiBzdHJ1Y3QuX19kaWN0X18ua2V5cygpOgogICAgICAgICAgICBzZXRhdHRyKHNlbGYsIGssIGdldGF0dHIoc3RydWN0LCBrKSkKCmYgPSBGb29UZXN0KFRlc3QoKSkKcHJpbnQoZi5hLCBmLmIpCg==