On 2007-09-12, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]> > wrote: >> On Sep 12, 2:42 pm, Steven D'Aprano <[EMAIL PROTECTED] >> >> cybersource.com.au> wrote: >> > On Wed, 12 Sep 2007 07:33:45 +0000, Mark Summerfield wrote: >> > In fact, I'm not sure what people mean by ordered dicts. I assume they >> > mean the keys are ordered, not the values. But ordered by what? Insertion >> > order? Modification order? Alphabetical order? >> >> Insertion order. >> >> M.S. > > > Actually I meant by key order, so insertion order doesn't matter at > all. If you need a dictionary-like data structure that respects > insertion order you could use a list of (key, value) tuples.
If you want a dictionary that iterates over his keys and does so in a sorted manner you probably want a tree. One posible implemenation can be found here: http://www.pardon-sleeuwaegen.be/antoon/avltree.html I hope it is usefull to you. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list