Setting python dict value to itself creates infinite copies

前端 未结 0 1511
耶瑟儿~
耶瑟儿~ 2020-12-30 02:45

Recentely I saw some piece of code that I can\'t understand. Here\'s the example:

a = {}
a[\'value\'] = a

print(a)
>>>> {\'value\': {...}}


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题