[Numpy-discussion] Re: weird interaction: pickle, numpy, matplotlib.hist

Travis Oliphant oliphant at ee.byu.edu
Mon Apr 10 16:37:06 CDT 2006

Andrew Jaffe wrote:

> Travis Oliphant wrote:
>> But,  this brings up the point that currently the pickled raw-data 
>> which is read-in as a string by Python is used as the memory for the 
>> new array (i.e. the string memory is "stolen").    This should work.  
>> The fact that it didn't with sort was a bug that is now fixed in 
>> SVN.  However, operations on out-of-byte-order arrays will always be 
>> slower.  Thus, perhaps on pickle read the data should be copied to 
>> native byte-order if necessary.
> +1 from me, too. I assume that byteswapping is fast compared to I/O in 
> most cases, and the only times when you wouldn't want it would be 
> 'advanced' usage that the developer could take control of via a custom 
> reduce, __getstate__, __setstate__, etc.

There was one reasonable objection, and one proposal to further 
complicate the array object to handle both cases :-)

But most were supportive of automatic conversion to the platform 
byte-order on pickle-read.  This is probably what most people expect if 
they are using Pickle anyway. 

So, I've added it to SVN.


More information about the Numpy-discussion mailing list