Update with pickle

Nicolas Fleury nid_oizo at yahoo.com_remove_the_
Tue May 25 12:22:07 EDT 2004


Matteo Dell'Amico wrote:

> Nicolas Fleury wrote:
> 
>> Is it possible to use the pickle module to update an object instead of 
>> creating a new instance?
> 
> 
> I don't get what you want to do. Can you explain yourself better? What 
> do you mean by "updating" an object?

Use the same reference instead of creating a new instance.  Basically 
making pickle call __init__ of an existing object.  The best solution I 
see for now is to copy the __dict__ of the new object to the existing 
one.  I want to update the content of an object with a dumped object of 
the same type so that all reference to existing object are still valid.

Regards,
Nicolas



More information about the Python-list mailing list