Op 2005-11-21, Christoph Zwerschke schreef <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: >> Personally, I have needs for ordered dict but I don't think it should >> be in standard library though, as different situation called for >> different behaviour for "ordered" and skewing my code to a standard lib >> way is no good. > > I have started the thread in the first place because I believed it is > pretty unabmiguous what an "ordered dictionary" is and how it should > behave. That's why I asked myself why something that straigthforward has > not been added to the standard lib yet. Maybe I'm wrong; I must admit > that I haven't meditated about it very much.
Well it doesn't seem that obvious, because the two recipes you have gotten, do something different from what I understand as an ordered dictionary. The two recipes order the keys by insertion order. My idea would have been that some order was defined on your keys in advance and that when you iterated over the dictionary, the results would be ordered in sequence of key order. > Do you have an example for different options of behavior? Well you have two above. Maybe someone can think of something else. Which behaviour are you looking for? -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list