A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-July/135471.html below:

[Python-Dev] Another case for frozendict

[Python-Dev] Another case for frozendictChris Angelico rosuav at gmail.com
Sun Jul 13 16:22:57 CEST 2014
On Mon, Jul 14, 2014 at 12:04 AM, Jason R. Coombs <jaraco at jaraco.com> wrote:
> I can achieve what I need by constructing a set on the ‘items’ of the dict.
>
>>>> set(tuple(doc.items()) for doc in res)
>
> {(('n', 1), ('err', None), ('ok', 1.0))}

This is flawed; the tuple-of-tuples depends on iteration order, which
may vary. It should be a frozenset of those tuples, not a tuple. Which
strengthens your case; it's that easy to get it wrong in the absence
of an actual frozendict.

ChrisA
More information about the Python-Dev mailing list

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