could that be a mutable object issue ?

Philippe C. Martin philippe at philippecmartin.com
Sat Feb 19 13:18:20 EST 2005


Yes, and that is my initial problem: I seem to write correctly that
'pickle string' to a device, by when I read it back, the appended
information is gone.


On Sat, 19 Feb 2005 19:13:58 +0100, Fredrik Lundh wrote:

> Philippe C. Martin wrote:
> 
>> print 'LEN OF BOOK BEFORE APPEND: ', len(pickle.dumps(self.__m_rw))
>> self.__m_rw.books.append( [p_col1,p_col2,p_col3] )
>> print 'LEN OF BOOK AFTER APPEND: ', len(pickle.dumps(self.__m_rw))
>>
>> I get the same length before and after append.
>>
>> when I print self.__m_rw.books, I see my 'appends' in there, yet the
>> pickled object does not change.
> 
> instead of checking the length, have you checked what
> 
>     pickle.loads(pickle.dumps(self.__m_rw))
> 
> returns?
> 
> </F>




More information about the Python-list mailing list