title: Why does SimpleNamespace have a different size than that of an empty class?
body: <p>Consider the following:</p>
  
  <pre><code>In [1]: import types
  
  In [2]: class A:
      ...:     pass
      ...:
  
  In [3]: a1 = A()
  
  In [4]: a1.a, a1.b, a1.c = 1, 2, 3
  
  In [5]: a2 = types.SimpleNamespace(a=1,b=2,c=3)
  
  In [6]: sys.getsizeof(a1)
  Out[6]: 56
  
  In [7]: sys.getsizeof(a2)
  Out[7]: 48
  </code></pre>
  
  <p>Where is this size discrepancy coming from? Looking at:</p>
  
  <pre><code>In [10]: types.__file__
  Out[10]: '/Users/juan/anaconda3/lib/python3.5/types.py'
  </code></pre>
  
  <p>I find:</p>
  
  <pre><code>import sys
  
  # Iterators in Python aren't a matter of type but of protocol.  A large
  # and changing number of builtin types implement *some* flavor of
  # iterator.  Don't check the type!  Use hasattr to check for both
  # "__iter__" and "__next__" attributes instead.
  
  def _f(): pass
  FunctionType = type(_f)
  LambdaType = type(lambda: None)         # Same as FunctionType
  CodeType = type(_f.__code__)
  MappingProxyType = type(type.__dict__)
  SimpleNamespace = type(sys.implementation)
  </code></pre>
  
  <p>Ok, well, here goes nothing:</p>
  
  <pre><code>&gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.implementation
  namespace(cache_tag='cpython-35', hexversion=50660080, name='cpython', version=sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0))
  &gt;&gt;&gt; type(sys.implementation)
  &lt;class 'types.SimpleNamespace'&gt;
  </code></pre>
  
  <p>I seem to be chasing my own tail here.</p>
  
  <p>I was able to find <a href="https://stackoverflow.com/questions/37161275/what-is-the-difference-between-simplenamespace-and-empty-class-definition">this related question</a>, but no answer to my particular query.</p>
  
  <p>I am using CPython 3.5 on a 64-bit system. These 8 bytes seem just the right size for some errant reference that I cannot pin-point.</p>