[PYTHON MATRIX-SIG] pickle error on Win95

Groma Geza GROMA@everx.szbk.u-szeged.hu
Thu, 21 Mar 1996 14:50:36 MET


> I've been waiting for somebody to notice this and properly castigate
> me for violating the beauty of pickle's text-only format.
> 
> There are some major size and speed savings to be realized by dumping
> large arrays in a binary format.  Since dumping 1 MB arrays to disk is
> not all that uncommon, these things are unfortunately an issue.
> 
> This is the first time that anybody's noticed problems with the binary
> format, and it seems a simple enough matter to add warnings that
> matrices should only be pickled to binary format files.  Other than
> this, I've found the binary format to work quite well for archiving
> arbitrary objects that contain matrices across many platforms
> (big/little endian) and even for passing these objects across sockets.
> 
> Anybody know a way I can add a check to the matrix pickling routines
> to determine if they're writing to/reading from a binary format file
> and raise an exception otherwise?
> 
> -Jim

I completely agree with the binary format for arrays. Is there any 
system where the "b" flag in open() causes problem? If not, I suggest to include 
this flag in TestPickle.py.

BTW could you upgrade TestSuite to be compatible 
with v0.35? I realized that in this version nonzero() does not return 
None. This makes sense, but in this case I really miss a special object 
representing an empty array, like [] or () for an empty list or tuple. 
Matlab introduces [] for that, and it is very extensively used there.



Geza I. Groma
Institute of Biophysics
Biological Research Centre of Hungarian Academy of Sciences
Szeged, Hungary

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================