Python module __builtin__ has no attribute NoneType
<p>For reasons out of scope of this question, I'm building a serialization mechanism.  I've run into a problem with <code>None</code> objects that I think I need to special case.  Can anybody explain why <code>NoneType</code> is treated differently from other builtin types?  Or am I missing something?</p>

<pre><code>&gt;&gt;&gt; import sys
&gt;&gt;&gt; builtin = sys.modules['__builtin__']
&gt;&gt;&gt; getattr(builtin,'int')
&lt;type 'int'&gt;
&gt;&gt;&gt; getattr(builtin,'list')
&lt;type 'list'&gt;
&gt;&gt;&gt; getattr(builtin,'NoneType')
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'module' object has no attribute 'NoneType'
</code></pre>

<p>python 2.6.5 on Ubuntu</p>

<h3>Clarification</h3>

<p>Of course</p>

<pre><code>getattr(builtin,'None')
</code></pre>

<p>works and returns a <code>None</code> object, which is an instance of <code>NoneType</code>.  But the class object exists in the <code>__builtin__</code> module for everything else.  So this code works for every built in type except <code>None</code>:</p>

<pre><code>klass = getattr(builtin, obj.__class__.__name__)
</code></pre>

<p>which makes sense given that</p>

<pre><code>&gt;&gt;&gt; type(0).__module__
'__builtin__'
&gt;&gt;&gt; type("foo").__module__
'__builtin__'
&gt;&gt;&gt; type(None).__module__
'__builtin__'
</code></pre>

<p>The fact that this fails for <code>None</code> seems like an oversight in Python, unless I'm missing something.</p>
