First, leave the original class definition intact so that it can be found when existing instances are unpickled.
首先,确保原来的类的定义没有被更改,以便在unpickle现有实例时可以找到它。
When a previously pickled instance is unpickled, its previously pickled state will be passed to _setstate_() as a dictionary, which will include values for the firstname and lastname attributes.
当对先前进行过 pickle 的实例执行 unpickle 时,其先前进行过 pickle 的状态会作为字典传递给 _setstate_() ,它将包括 firstname 和 lastname 属性的值。
应用推荐