On Sep 29, 4:23 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
[...]
> Another example would be if you had a library which serialised a dictionary
> to xml. There is nothing wrong with the library if it doesn't care about
> order, but if you have some other reason why you want the xml to be stable
> (e.g. because you store it in a version control system and want to compare
> revisions) then a sorteddict would allow you to impose that behaviour on
> the library from outside.
>
> Contrary to my earlier insistence that sorteddict is only really useful if
> you can have a key parameter, both of these examples simply want an
> arbitrary but defined order of iteration for dictionary keys. A much
> simpler sorteddict that has been discussed earlier would be sufficient.

In fact, a dictionary that maintains insertion order would work in
this case too.

-- bjorn

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to