In [17]: class Td(): ...: def __init__(self): ...: self.a = 1 ...: self.b = '234' ...: In [18]: In [18]: td = Td() In [19]: td.__dict__ Out[19]: {'a': 1, 'b': '234'}
其实我们在给对象复制,修改,程序就在调用__ditct__