| Store | Cart

The Order Of Dictionary Entries

From: Terry Reedy <tjre...@udel.edu>
Wed, 10 Mar 2004 12:28:01 -0500
"Tim Daneliuk" <tundra at tundraware.com> wrote in message
news:in93i1-ctp1.ln1 at eskimo.tundraware.com...
> I am aware that dictionary order is not guaranteed.  But I ran into> something puzzling today.  I filled a dictionary dynamically as a> program ran.  Up to a certain point, the key order was the order> in which things were added.

I am rather certain that this was an accident dependent on you adding the
keys in the order in which they were going to displayed.  Try adding the
items in a different order and the display order should not change much if
at all.  Example:

>>> {1:1, 2:2}
{1: 1, 2: 2}
>>> {2:2, 1:1}
{1: 1, 2: 2}

Terry J. Reedy

Recent Messages in this Thread
Tim Daneliuk Mar 10, 2004 11:11 am
Aahz Mar 10, 2004 11:57 am
Terry Reedy Mar 10, 2004 05:28 pm
Messages in this thread