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/080402.html below:

[Python-Dev] Proposal: add odict to collections

[Python-Dev] Proposal: add odict to collections [Python-Dev] Proposal: add odict to collectionsHasan Diwan hasan.diwan at gmail.com
Sun Jun 15 06:38:01 CEST 2008
2008/6/14 Talin <talin at acm.org>:
> There's been a lot of controversy/confusion about ordered dicts. One of the
> sources of confusion is that people mean different things when they use the
> term "ordered dict": In some cases, the term is used to mean a dictionary
> that remembers the order of insertions, and in other cases it is used to
> mean a sorted dict, i.e. an associative data structure in which the entries
> are kept sorted. (And I'm not sure that those are the only two
> possibilities.)

Have the comparison function passed in as a parameter then, if it's
None, then have it maintain the order of insertion? Something like:
def __init__(self, cmpfunc = None):
   self.dict = dict()

def __getattr__(self, key):
   try: return self.key

-- 
Cheers,
Hasan Diwan <hasan.diwan at gmail.com>
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