Ordered dict by default
fakeaddress at nowhere.org
Thu Feb 5 18:31:56 CET 2009
> Paul Rubin wrote:
>> bearophileHUGS at lycos.com writes:
>>> Now Ruby dicts are ordered by default:
>> Maybe I didn't read that carefully enough, but it looks like "ordered"
>> means the dict records come out in the same order you inserted them
>> in. That is if you insert B,A,D,C in that order, you get them out in
>> that order. I would have thought an ordered dict meant you get A,B,C,D,
>> which seems a lot more useful.
> You're confusing "ordered" with "sorted"! :-)
He's really not.
> A list is an ordered collection, for example.
More information about the Python-list