[pickle] Different version of a class

Emile van Sebille emile at fenx.com
Sun Jun 6 13:39:02 EDT 1999


It seems I've seen references ( a quick scan of dejanews didn't locate them
however) to keeping a version variable in your data that you inspect upon
loading.  Based on this, you can initialize just the new fields.

--

Emile van Sebille
emile at fenx.com
-------------------


<mlauer at asmoday-atm.rz.uni-frankfurt.de> wrote in message
news:375a9760 at nntp.server.uni-frankfurt.de...
> Hi,
>
> my application uses pickle to store and load data.
>
> During developing cycle, many variables are added
> to the classes which are pickled. Whenever I load
> a file pickled with a previous version, some
> variables are not existent (naturally, because
> __init__ is not called). Is there an easy way
> to initialize the "new" variables or must I
> call __init__ - which would overwrite some of
> my saved variables.
>
> Any idea ?
>
> --
>     Regards & Gruesse from Mickey @ http://www.Vanille.de
>   ---------------------------------------------------------
>   How could anyone know me - when I don't even know myself ?
>
>






More information about the Python-list mailing list