Frankie,

Dictionaries do not sort in python because it's much faster to leave it
unordered and most of the time it isn't necessary.
If you really need ordered dictionaries you can use
http://pypi.python.org/pypi/ordereddict for Python <2.7. If you are using
python 2.7+ then you can import it from collections. See
http://docs.python.org/library/collections.html#collections.OrderedDict

Hope this helps.

Glen

On Tue, May 8, 2012 at 6:27 AM, Cranky Frankie <[email protected]>wrote:

> On Mon, May 7, 2012 at 10:31 PM, bob gailer <[email protected]> wrote:
>
> > Asking why does it not do what I want is not IMHO the best way to win
> > friends here.
>
> Good morning to you to, Bob.
>
> I see now that dictionaries in Python act like relational databases in
> that there is no inherent ordering. At first, when I simply wanted to
> print one entry and it came out in what looked like a random order,
> this didn't occur to me. A normal "dictionary" is in fact ordered.
>
> Sorry for the disturbance.
>
> --
> Frank L. "Cranky Frankie" Palmeri
> Risible Riding Raconteur & Writer
> “The problem with quotes on the Internet is that
> it is often difficult to verify their authenticity.”
> - Abraham Lincoln
> _______________________________________________
> Tutor maillist  -  [email protected]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to