📅  最后修改于: 2022-03-11 14:45:26.054000             🧑  作者: Mango
>>> import dill
>>> import weakref
>>> dill.loads(dill.dumps(weakref.WeakKeyDictionary()))
>>> dill.loads(dill.dumps(weakref.WeakValueDictionary()))
>>> class _class:
... def _method(self):
... pass
...
>>> _instance = _class()
>>> dill.loads(dill.dumps(weakref.ref(_instance)))
>>> dill.loads(dill.dumps(weakref.ref(_class())))
>>> dill.loads(dill.dumps(weakref.proxy(_instance)))
>>> dill.loads(dill.dumps(weakref.proxy(_class())))