<div dir="ltr">Sounds reasonable for me. Thanks!<br><br><div class="gmail_quote">On Sun, Feb 26, 2012 at 3:16 PM, Eli Bendersky <span dir="ltr"><<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5"><br><br><div class="gmail_quote">On Sun, Feb 26, 2012 at 15:09, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 26 February 2012 12:34, Eli Bendersky <<a href="mailto:eliben@gmail.com" target="_blank">eliben@gmail.com</a>> wrote:<br>
> On Sun, Feb 26, 2012 at 12:33, pmon mail <<a href="mailto:pmon.mail@gmail.com" target="_blank">pmon.mail@gmail.com</a>> wrote:<br>
</div><div>>> Documentation clearly states that the 'L' is a 4 byte integer.<br>
>><br>
>> Is this a bug? I'm I missing something?<br>
>><br>
><br>
> By default pack uses native size, not standard size. On a 64-bit machine:<br>
<br>
</div>As the OP points out, the documentation says that the "Standard Size"<br>
is 4 bytes (<a href="http://docs.python.org/library/struct.html" target="_blank">http://docs.python.org/library/struct.html</a>). While<br>
"Standard Size" doesn't appear to be defined in the documentation, and<br>
the start of the previous section (7.3.2.1. Byte Order, Size, and<br>
Alignment) clearly states that C types are represented in native<br>
format by default, the documentation could probably do with some<br>
clarification.<br>
<span></span><br></blockquote></div><br></div></div>7.2.3.1 says, shortly after the first table:<br><br>"
<p>Native size and alignment are determined using the C compiler’s
<tt><span>sizeof</span></tt> expression. This is always combined with native byte order.</p>
<p>Standard size depends only on the format character; see the table in
the <a href="http://docs.python.org/library/struct.html#format-characters" target="_blank"><em>Format Characters</em></a> section.</p>"<br><br>To me this appears to be a reasonable definition of what "standard size" is. <br>
<br>7.3.2.2 says before the size table:<br><br>"Format characters have the following meaning; the conversion between C and
Python values should be obvious given their types. The ‘Standard size’ column
refers to the size of the packed value in bytes when using standard size; that
is, when the format string starts with one of <tt><span>'<'</span></tt>, <tt><span>'>'</span></tt>, <tt><span>'!'</span></tt> or
<tt><span>'='</span></tt>. When using native size, the size of the packed value is
platform-dependent."<br><br>Again, taken together with the previous quote, IMHO this defines the difference between standard and native sizes clearly. If you feel differently, feel free to open an issue suggesting a better explanation.<span class="HOEnZb"><font color="#888888"><br>
<br>Eli<br><br><br><br></font></span></div>
</blockquote></div><br></div>