<div dir="ltr"><div>How does a frozendict help in that example? It's not obvious to me.</div><div><br></div>Despite not understanding that example, I'm +1 for having a frozendict. I don't think it'll increase cognitive load much, as it'll sit right next to frozenset when someone reads the builtins in alphabetical order. In my own experience, I want to use a dict as a dict key about once or twice a year. It'd be nice to have a quick way to convert to a frozendict.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 10, 2018 at 10:05 AM Philip Martin <<a href="mailto:philip.martin2007@gmail.com">philip.martin2007@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi, I first want to thank everyone in the community for the contributions over the years. I know the idea of a frozendict has been proposed before and rejected. I have a use case for a frozendict implementation that to my knowledge was not discussed during previous debates. My reasoning for a frozendict class stems from patterns I typically see arise when performing ETL or data integrations and conversions. I generally have used MappingProxyType as a way to set default mapping to a function or to set an empty mapping to a function. I've created a gist with an example use case:<div><br></div><div><a href="https://gist.github.com/pmart123/493edf84d9aa61691ca7321325ebb6ab" target="_blank">https://gist.github.com/pmart123/493edf84d9aa61691ca7321325ebb6ab</a><br></div><div><br></div><div>I've included an example of what code typically looks like when using MappingProxyType and what it could look like with a frozendict implementation. I believe this use case may also be under-reported in open source code as it often crops up when integrating third-party data sources, which at times can't be open sourced due to licensing issues. I would love to hear if anyone has used MappingProxyType in a similar manner, or if this use case could help warrant a frozendict in the standard library.</div></div></div>
_______________________________________________<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/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div>