I think you misunderstand the distinction between immutable and read-only. MappingProxyType is read-only -- you cannot modify the underlying dict through the proxy. But it's not immutable -- if the underlying dict is changed directly (e.g. by assignment to a class attribute) the proxy is changed too. So making the proxy hashable would be a mistake.
What real-world use case do you have for this?
On Thu, Jul 28, 2016 at 3:01 PM, Emanuel Barry firstname.lastname@example.org wrote:
Hello Python-ideas, While answering a question earlier today, I realized that types.MappingProxyType is immutable and unhashable. It seems to me that if all values are hashable (all keys are already guaranteed to be hashable), then the mappingproxy itself should be hashable. Should I go ahead and make a patch for this, or is this a bad idea?
Python-ideas mailing list Pythonemail@example.com https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
-- --Guido van Rossum (python.org/~guido)