Re: [Python-Dev] Packing and unpacking integers

2008-07-06 Thread Martin v. Löwis
> I believe there is still a need for packing integers as strings and > unpacking strings as integers, more specifically, offering to Python > an interface to _PyLong_FromByteArray() and _PyLong_AsByteArray(). I > would be happy to write the functionality and unittests this coming > week for 2.6 a

[Python-Dev] Packing and unpacking integers

2008-07-05 Thread Josiah Carlson
A few years ago (yes, it's been that long), I proposed adding a new format code to struct that would pack integers as strings, similar to the 's' format code. In particular, struct.pack('>60G', v) would be a 60-byte big-endian unsigned integer as a string. The feature request is http://bugs.pytho