I'm just curious, just what _is_ the approach used for ordering
dictionary keys?
(This was confirmed on both Unix and Win32, BTW).
--
----------------------------------------------------------------------------
Tim Daneliuk tun...@tundraware.com
PGP Key: http://www.tundraware.com/PGP/
Use the source, Luke. See Objects/dictobject.c
Hint: dicts are based on hashing.
--
Aahz (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/
"Do not taunt happy fun for loops. Do not change lists you are looping over."
--Remco Gerlich, comp.lang.python
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