Python Boolean comparison
<p>I'm testing Python's Boolean expressions. When I run the following code:</p>

<pre><code>x = 3
print type(x)
print (x is int)
print (x is not int)
</code></pre>

<p>I get the following results:</p>

<pre><code>&lt;type 'int'&gt;
False
True
</code></pre>

<p>Why is (x is int) returning false and (x is not int) returning true when clearly x is an integer type?</p>

<p>If you want to use <code>is</code> you should do:</p>

<pre><code>&gt;&gt;&gt; print (type(x) is int)
True
</code></pre>

python boolean boolean-logic boolean-expression