Does dictionary's clear() method delete all the item related objects from memory?

后端 未结 7 1608
梦毁少年i
梦毁少年i 2020-12-23 17:26

If a dictionary contains mutable objects or objects of custom classes (say a queryset, or a even a DateTime), then will calling clear() on the dictionary delet

7条回答
  •  臣服心动
    2020-12-23 17:28

    In your case, the two MyClass objects are shared. They will still be accessible via the my_obj_1 and my_obj_2.

提交回复
热议问题