Showing content from http://mail.python.org/pipermail/python-dev/attachments/20100516/c8fd32eb/attachment.html below:
<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">> So I'm thinking either we make an<br>
> immutable/hashable dict while we're at it, or store the keyword<br>
> arguments as a tuple (which guarantees immutability), and only<br>
> convert them back to a dict when you want to call the partial object<br>
> (simpler, slower).<br>
<br>
</div>I'd support an immutable dict. [...]</blockquote><div><br></div><div>I've set out to implement a frozendict (like frozenset) for use to store functools.keywords' attribute, and quickly realized I didn't think of an obvious flaw in that idea. A frozenset will only accept hashable members, but a frozendict can't afford this luxury for its values.</div>
<div><br></div><div>I'm not sure how should I go about handling that, if at all. Should I implement a frozendict which will remain unhashable but support equality testing like a regular dict? A frozendict that is only hashable if all its values are hashable, like a tuple? Is the whole notion of a frozendict worthy, given this limitation?</div>
<div><br></div><div>I'd be happy to hear python-dev's guidance on this.</div><div><br></div><div>Cheers,</div><div>Â - Yaniv</div></div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4