<div dir="ltr">The difference in hits might be because MappingProxyType has a funny name and is in a hidden-ish location. I.e. not necessarily because it *would be* less used or useful if it were more exposed.<div><br></div><div>In either case, the name that makes sense to me would be `frozendict`. That could very well live in `collections` of course.<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 28, 2017 at 7:40 AM, Ivan Levkivskyi <span dir="ltr"><<a href="mailto:levkivskyi@gmail.com" target="_blank">levkivskyi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Searching MappingProxyType on GitHub gives over 10,000 results.<br>I think it probably makes sense to make mappingproxy more "visible",<br>maybe move it to collections module? (where OrderedDict lives)<br><br></div>I am not sure if it makes sense to move it to builtins. (for comparison frozenset gives around 1000,000 results)<br><br>--<br></div>Ivan <br><div><div><br><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 28 February 2017 at 16:24, Joseph Hackman <span dir="ltr"><<a href="mailto:josephhackman@gmail.com" target="_blank">josephhackman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+1<br>
<br>
I think this makes a lot of sense. What would you name the built in?<br>
<span class="m_-6159540040656993137HOEnZb"><font color="#888888"><br>
-Joseph<br>
</font></span><div class="m_-6159540040656993137HOEnZb"><div class="m_-6159540040656993137h5"><br>
> On Feb 28, 2017, at 7:17 AM, Michel Desmoulin <<a href="mailto:desmoulinmichel@gmail.com" target="_blank">desmoulinmichel@gmail.com</a>> wrote:<br>
><br>
> We have the immutable frozenset for sets and and tuples for lists.<br>
><br>
> But we also have something to manipulate dict as immutable datastructures:<br>
><br>
>>>> from types import MappingProxyType as idict<br>
>>>> d = idict({'a':1, 'b':2, 'c':3})<br>
>>>> d['a'] = 4<br>
> Traceback (most recent call last):<br>
> File "<ipython-input-3-c6f93d6278af<wbr>>", line 1, in <module><br>
> d['a'] = 4<br>
> TypeError: 'mappingproxy' object does not support item assignment<br>
><br>
> We could expose this as a built type to allow the last of the most<br>
> important data structure in Python to be easily immutable.<br>
><br>
> ______________________________<wbr>_________________<br>
> Python-ideas mailing list<br>
> <a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
> Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons. Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div>
</div></div></div>