Sequenced dictionaries

Magnus Lie Hetland mlh at
Mon Nov 5 15:07:31 CET 2001

"Morten W. Petersen" <morten at> wrote in message
news:Pine.LNX.4.21.0111051436400.21948-100000 at
> Hi,
> I'm wondering if there exists any C-based implementations of sequenced
> dictionaries, i.e. dictionaries that will remember the order of the
> objects 'added' on it.
> I have a pure python implementation [1] but suspect that it will be
> too slow..  Alternatively, if anyone could have a look at it and give
> some optimization tips, that would be greatly appreciated.

Just a thought... You might want to consider using a tree structure.
There you get ordering _and_ logarithmic lookup. I think there are
several implementations out there, both in Python and as C extension

> [1]
> -Morten

Magnus Lie Hetland                       The Anygui Project             

More information about the Python-list mailing list