 <p>The <a href="http://docs.python.org/2/reference/expressions.html#is" rel="nofollow">Python <code>is</code> operator</a> checks for <em>object identity</em>, not object value. The two integers must refer to the same actual object internally for is to return true.</p> <p>This will return true for "small" integers due to an internal cache maintained by Python, but two numbers with the same value will not return true if compared with <code>is</code> in general.</p>