What the difference between dict_proxy in python2 and mappingproxy in python3?
<p>I notice when I create class in python2 it stores attributes in <code>dict_proxy</code> object:  </p>

<pre><code>&gt;&gt;&gt; class A(object):
...     pass
&gt;&gt;&gt; A.__dict__
dict_proxy({....})
</code></pre>

<p>But in python3 <code>__dict__</code> returns <code>mappingproxy</code>:  </p>

<pre><code>&gt;&gt;&gt; class A(object):
...     pass
&gt;&gt;&gt; A.__dict__
mappingproxy({....})
</code></pre>

<p>Is there any difference between two of them?</p>

<p>There is no real difference, it <a href="https://hg.python.org/cpython/diff/c3a0197256ee/Objects/descrobject.c" rel="nofollow">just got renamed</a>.</p>

<p>When it was proposed to expose the type in the <code>typing</code> module in <a href="http://bugs.python.org/issue14386" rel="nofollow">issue #14386</a>, the object was renamed too:</p>

<blockquote>
  <p>I'd like to bikeshed a little on the name. I think it should be
  MappingProxy. (We don't use "view" much but the place where we do use
  it, for keys/values/items views, is very different I think. Also
  collections.abc already defines MappingView as the base class for
  KeysView and friends.)</p>
</blockquote>

<p>and</p>

<blockquote>
  <p>Anyway, you are not the first one who remarks that we already use "view" to define something else, so I wrote a new patch to use the "mappingproxy" name (exposed as types.MappingProxyType).</p>
</blockquote>

<p>The change <a href="https://docs.python.org/3/whatsnew/3.3.html#types" rel="nofollow">made it into Python 3.3</a>, so in Python 3.2 you'll still see the old name.</p>

python python-3.x python-2.x python-internals