Python: is 'int' a type or a function?
<p>I did this in Python 3.4:</p>

<pre><code>&gt;&gt;&gt; type(int)
&lt;class 'type'&gt;
&gt;&gt;&gt; int(0)
0
</code></pre>

<p>Now I am wondering what int actually is. Is it a type, or is it a function? Is it both? If it is both, is it also true that all types can be called like functions?</p>

<p>It's both. In Python, the types have associated functions of the same name, that coerce their argument into objects of the named type, if it can be done.  So, the type <code>int</code> <code>&lt;type 'int'&gt;</code>has a function <code>int</code> along with it.</p>

python