This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hniksic
Recipients alexandre.vassalotti, benjamin.peterson, gvanrossum, hniksic, jcea, loewis, rhettinger
Date 2008-08-12.10:29:29
SpamBayes Score 2.9253286e-09
Marked as misclassified No
Message-id <1218536973.63.0.436333195078.issue2389@psf.upfronthosting.co.za>
In-reply-to
Content
I think preserving integer width is a good idea because it saves us from
having to throw overflow errors when unpickling to machines with
different width of C types.  The cost is that pickling/unpickling the
array might change the array's typecode, which can be a problem for C
code that processes the array's buffer and expects the C type to remain
invariant.

Instead of sticking to network byte order, I propose to include byte
order information in the pickle (for example as '<' or '>' like struct
does), so that pickling/unpickling between the same-endianness
architectures doesn't have to convert at all.  Floats are always pickled
as IEEE754, but the same optimization (not having to convert anything)
would apply when unpickling a float array on an IEEE754 architecture.

Preserving widths and including endianness information would allow
pickling to be as fast as it is now (with the exception of unicode chars
and floats on non-IEEE754 platforms).  It would also allow unpickling to
be as fast between architecture with equal endianness, and correct
between others.
History
Date User Action Args
2008-08-12 10:29:33hniksicsetrecipients: + hniksic, gvanrossum, loewis, rhettinger, jcea, alexandre.vassalotti, benjamin.peterson
2008-08-12 10:29:33hniksicsetmessageid: <1218536973.63.0.436333195078.issue2389@psf.upfronthosting.co.za>
2008-08-12 10:29:30hniksiclinkissue2389 messages
2008-08-12 10:29:29hniksiccreate