How to serialize hash objects in Python

那年仲夏 提交于 2019-12-04 18:50:32

Since you can't serialize HASH objects with shelve, you would have to provide the same information in a different way. For example, you could only save the digest of the hash.

Something in cliente, the instance of client class, is not picklable. Here is a list of those types which are picklable.

The code you've posted does not show what cliente contains which is not picklable. But you can solve the problem by either removing the unpicklable attribute if it is not needed, or by defining __getstate__ and __setstate to make client picklable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!