title: Function is an object of class in python?
body: <p>I read that a function is an object of a class in python.To further understand, i did below:</p>
  
  <pre><code>&gt;&gt;&gt; a=10
  &gt;&gt;&gt; a.__class__
  &lt;type 'int'&gt;
  &gt;&gt;&gt; int.__class__
  &lt;type 'type'&gt;
  &gt;&gt;&gt;
  &gt;&gt;&gt;
  &gt;&gt;&gt; def T1():
  ...     print 'test'
  ...
  &gt;&gt;&gt; T1.__class__
  &lt;type 'function'&gt;
  &gt;&gt;&gt; function.__class__
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  NameError: name 'function' is not defined
  </code></pre>
  
  <p>Q:why does the interpreter throw an error in the second case and not in the first case? I was expecting it to return <code>&lt;type 'type'&gt;</code>.Please correct my understanding.</p>