[issue18607] struct.unpack
Tim Peters
report at bugs.python.org
Wed Jul 31 22:29:32 CEST 2013
Tim Peters added the comment:
Looks fine to me. The third one uses native size and alignment (see the "Byte Order, Size, and Alignment" section of the struct docs). After the first 5 B's, a pad byte is inserted so that the next H is properly aligned (to a 2-byte boundary). That makes 6 bytes so far. H then takes 2 bytes, making 8 bytes so far. The final B adds the 9th byte. As the docs say, < and > do no padding, so no pad byte is added in the first two cases.
----------
nosy: +tim_one
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18607>
_______________________________________
More information about the Python-bugs-list
mailing list