pickling and endianess

Chandrashekhar Kaushik shekhar.kaushik at gmail.com
Fri Aug 25 02:17:16 EDT 2006


Thank you for the information.
A request though.

I am actually looking to implement serialization routines in C++.
An am facing the problem of how to tackle endianess and sizeof issues.

Could you give me a overview of how pickling is done in python ? Reading
pickle.py is obviously the option , but its getting daunting as i am not
that proficient in python :( .


On 8/25/06, Tim Peters <tim.peters at gmail.com> wrote:
>
> [Chandrashekhar kaushik]
> > Can an object pickled and saved on a little-endian machine be unpickled
> > on a big-endian machine ?
>
> Yes.  The pickle format is platform-independent (native endianness
> doesn't matter, and neither do the native sizes of C's various integer
> types).
>
> > Does python handle this in some manner  , by say having a flag to
> indicate
> > the endianess of the machine on which the object was pickled ?  And then
> > using this flag to decide how that data will be unpickled ?
>
> Not a flag, no, the pickle format is the same on all platforms.  If
> you need to know details, read pickle.py.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
--
shekhar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060825/5d7344fa/attachment.html>


More information about the Python-list mailing list