How to cope with changes to object definition between pickle and unpickle #378
Description
I may have missed something, but reading the docs for picking I have not seen any comments about what to do if I update the classes that define the pickled data. So if I am running an application with version 1 of a data class, pickle the data and store it in a file, load a new version of the JAR containing the classes and try to unpickle the data, what will happen.
Presumably if none of the data fields (as opposed to methods) have changed then all should be well, but how does the unpickling process cope with either old fields which no longer exist, or new ones that have been created. Presumeably new fields are not a problem if they have default values, and I could always leave old fields and just stop using them. But what I do not want to happen is for the unpickle to fail.
David