Message95474
What Eric said. You can see the padding explicitly in the results of
struct.pack:
>>> struct.pack("ci", '*', 0x12131415) # 8-byte result, 3 padding bytes
'*\x00\x00\x00\x15\x14\x13\x12'
>>> struct.pack("ic", 0x12131415, '*') # 5-byte result, no padding.
'\x15\x14\x13\x12*'
Note the 3 zero bytes in the first result string.
This gets reported frequently enough that I wonder whether the docs
should be rearranged and/or expanded. The existence of padding is
mentioned, but not particularly prominently or thoroughly. |
|
Date |
User |
Action |
Args |
2009-11-19 14:33:04 | mark.dickinson | set | recipients:
+ mark.dickinson, eric.smith, sgk284 |
2009-11-19 14:33:04 | mark.dickinson | set | messageid: <1258641184.35.0.597842496306.issue7355@psf.upfronthosting.co.za> |
2009-11-19 14:33:02 | mark.dickinson | link | issue7355 messages |
2009-11-19 14:33:01 | mark.dickinson | create | |
|