Re: pickle and module versioning

2018-12-18 Thread dieter
Neal Becker writes: > ... > Has anyone else run into this issue People who use the "ZODB" (= "Zope Object DataBase") are familiar with it. > and have any ideas? There are things, you must not do. In the "ZODB" case, for example, you must not change whether the class inherits from "persistent.Pe

Re: pickle and module versioning

2018-12-17 Thread Peter Otten
Neal Becker wrote: > I find pickle really handy for saving results from my (simulation) > experiments. But recently I realized there is an issue. Reading the > saved results requires loading the pickle, which in turn will load any > referenced > modules. Problem is, what if the modules have cha

RE: pickle and module versioning

2018-12-17 Thread Calvin Spealman
This can definitely be a problem, but there are tried and true strategies to deal with it and the best course of action depends a lot on what works for you. Pickle deserialization is just an API instantiating your class instances. That means all the same rules and approaches to API changes apply