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/2008-June/080462.html below:

[Python-Dev] Proposal: add odict to collections

[Python-Dev] Proposal: add odict to collections [Python-Dev] Proposal: add odict to collectionsdbpokorny at gmail.com dbpokorny at gmail.com
Mon Jun 16 08:26:35 CEST 2008
It is possible to get both ordered dict and sorted dict semantics in
the same type if you replace (key, value) pairs for dictionary entries
with (key,value,order) triples. The third component is a value that
indicates the place of the entry relative to the other entries. To get
an ordered dict, __setitem__ assigns 1+ max(order) to the new entry's
order. To get a sorted dict, order = key. To get a dict sorted by some
key function, order = keyfunc(key), etc...

David
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