serialization and versioning

N

Neal Becker

I wonder if there is a recommended approach to handle this issue.

Suppose objects of a class C are serialized using python standard pickling.
Later, suppose class C is changed, perhaps by adding a data member and a new
constructor argument.

It would see the pickling protocol does not directly provide for this - but is
there a recommended method?

I could imagine that a class could include a class __version__ property that
might be useful - although I would further expect that it would not have been
defined in the original version of class C (but only as an afterthought when it
became necessary).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top