pack a three byte int

John Machin sjmachin at lexicon.net
Thu Nov 9 12:07:27 EST 2006


Dave Opstad wrote:
> Sorry, that should have been:
>
> cdb += struct.pack(">L", skip)[1:]
>

">L" and ">I" produce exactly the same 4-byte result. The change from
[-3:] to [1:] is a minor cosmetic improvement, but obscures the
underlying ... a bit like putting mascara on a pig. I got the
impression that the OP was interested in more radical improvement.

Cheers,
John




More information about the Python-list mailing list