Packing a long long type

Tim Peters tim.one at home.com
Wed Jun 20 01:21:59 CEST 2001


[Rich J]
> Does anyone know how it would be possible to pack a list containing
> 'long long' types (like 111111111111111L) and other standard types
> (int, string, char).

I don't know what you mean by "pack".  The std pickle/cPickle modules have
no trouble with these, though.  Note that 111111111111111L is an instance of
Python's unbounded int type.

> I know you can use the struct module to pack all but the 'long long'.

Note that struct in 2.2 has new 'q' and 'Q' format codes, for the C
compiler's notion of signed and unsigned "long long" (__int64 under Windows)
in native modes, and x-platform 8-byte ints in standard modes.





More information about the Python-list mailing list