[NumPy-Tickets] [NumPy] #1802: Problem pickling length-1 boolean arrays

NumPy Trac numpy-tickets@scipy....
Mon Apr 18 01:12:08 CDT 2011


#1802: Problem pickling length-1 boolean arrays
----------------------------+-----------------------------------------------
 Reporter:  eewallace       |       Owner:  somebody   
     Type:  defect          |      Status:  new        
 Priority:  normal          |   Milestone:  Unscheduled
Component:  Other           |     Version:  1.5.1      
 Keywords:  pickle boolean  |  
----------------------------+-----------------------------------------------
 If I pickle a dictionary containing two length one numpy arrays with dtype
 'bool' and the same value (e.g.
 dict(a1=numpy.array([False]),a2=numpy.array([False]), when the data is
 unpickled, the resulting arrays contain references to the same boolean
 objects, so that changing the value of one of them changes both. The
 attached text file contains a transcript of a short IPython session
 illustrating the problem.
 This seems to come up specifically with the standard pickle module, not
 with cPickle. It also occurs with arrays that are data members of separate
 class instances, which is where I first encountered it.
 I've produced this on two Linux installations, one Arch Linux with python
 2.7.1, and numpy 1.5.1, both built under gcc 4.5, the other with Red Hat
 4.1, python 2.6.6, numpy 1.5.1 and gcc 4.1.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1802>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list