[Python-ideas] Make types.MappingProxyType hashable
elazarg at gmail.com
Fri Jul 29 10:50:25 EDT 2016
> Date: Thu, 28 Jul 2016 22:23:35 +0000
> From: Emanuel Barry <vgr255 at live.ca>
> To: "guido at python.org" <guido at python.org>
> Cc: "python-ideas at python.org" <python-ideas at python.org>
> Subject: Re: [Python-ideas] Make types.MappingProxyType hashable
>> What real-world use case do you have for this?
> Not me, actually. Someone in #python asked about an immutable dict, > and
I pointed them towards mappingproxy, only to realize it wasn't hashable.
Maybe something like frozendict could be added, though? At this point I
don't really have an opinion, so it's up to the list to decide if they want
it or not :)
If the keys can be converted to/from valid identifiers, and the values are
hashable, then namedtuple can give you your frozendict.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas