title: Why is `function` not a keyword in Python?
body: <p>Classes like <code>str</code> or <code>type</code> </p>
  
  <pre><code>&gt;&gt;&gt; type("pear")
  &lt;class 'str'&gt;
  &gt;&gt;&gt; type(str)
  &lt;class 'type'&gt;
  </code></pre>
  
  <p>are accessible in Python:</p>
  
  <pre><code>&gt;&gt;&gt; str
  &lt;class 'str'&gt;
  &gt;&gt;&gt; type
  &lt;class 'type'&gt;
  </code></pre>
  
  <p>However, classes <code>function</code> and <code>builtin_function_or_method</code> are not. </p>
  
  <pre><code>&gt;&gt;&gt; def foo(): pass
  ... 
  &gt;&gt;&gt; type(foo)
  &lt;class 'function'&gt;
  &gt;&gt;&gt; type(print)
  &lt;class 'builtin_function_or_method'&gt;
  </code></pre>
  
  <p>They appear as builtin classes but trying to access them throws name errors:</p>
  
  <pre><code>&gt;&gt;&gt; function
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  NameError: name 'function' is not defined
  &gt;&gt;&gt; builtin_function_or_method
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  NameError: name 'builtin_function_or_method' is not defined
  </code></pre>
  
  <p>What's special about <code>function</code> and <code>builtin_function_or_method</code> ? </p>