<div class="gmail_quote">On Tue, Oct 6, 2009 at 9:58 AM, Dave Angel <span dir="ltr">&lt;<a href="mailto:davea@ieee.org">davea@ieee.org</a>&gt;</span> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

&lt;snip&gt; </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">No, because you&#39;re not assured that all integers that are equal are the same object.  Python optimizes that for small integers, but there&#39;s no documented range that you can count on it.<br>


<br></blockquote><div><br></div><div>But for this specific case - checking a return code against zero, should it still be considered unreliable? The only case that you are looking for correctness is 0 == 0, any other case should evaluate as false, so I guess the question is does python always optimize for zero? Any other optimization is irrelevant, AFAIK.</div>

<div><br></div><div>-Wayne</div></div>