[docs] struct package documentation bug

Petr Viktorin encukou at gmail.com
Fri Nov 20 18:53:31 EST 2015


On Sat, Nov 21, 2015 at 12:24 AM, Colton Williams
<cwilliams at spotxchange.com> wrote:
> The documentation for the `struct` package
> https://docs.python.org/2/library/struct.html indicates that using ‘l’
> (that’s an ‘l’ as in leopard) as the format character for the pack function
> will return 4 bytes. Using that format character appears to actually return
> 8 bytes of data.

Hello,
Are you by any chance using native data sizes? As explained in the
"Byte Order, Size, and Alignment" section, you need to put one of the
characters =, <, >, or ! at the start of the format string to select
the "standard" sizes.


More information about the docs mailing list