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__

相关文章:

  • 2021-11-30
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-01-17
  • 2021-09-09
  • 2022-01-22
相关资源
相似解决方案