En Mon, 12 Oct 2009 12:17:52 -0300, Peng Yu <pengyu...@gmail.com> escribió:

If I define my own class and use pickle to serialize the objects in
this class, will the serialized object be successfully read in later
version of python.

From <http://docs.python.org/library/pickle.html>: "The pickle serialization format is guaranteed to be backwards compatible across Python releases." What you save now should be readable by a later version. Your own class must be able to process what you saved (regarding added/deleted/renamed attributes, changes in meaning, renamed/moved classes...)

What if I serialize (using pickle) an object of a class defined in
python library, will it be successfully read in later version of
python?

As JPC said: no guarantees.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to