在Python中,使用 pickle 保存 dict 对象时报错:
TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled
修改第 3 个参数为 -1:
pickle.dump(obj, open(file, 'wb'), -1)
在Python中,使用 pickle 保存 dict 对象时报错:
TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled
修改第 3 个参数为 -1:
pickle.dump(obj, open(file, 'wb'), -1)