pickle and module versioning

Neal Becker ndbecker2 at gmail.com
Mon Dec 17 07:02:28 EST 2018


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 changed?

For example, I just re-implemented a python module in C++, in a not quite 
compatible way.  AFAIK, my only choice to not break my setup is to choose a 
different name for the new module.

Has anyone else run into this issue and have any ideas?  I can imagine 
perhaps some kind of module versioning could be used (although haven't 
really thought through the details).

Thanks,
Neal



More information about the Python-list mailing list