Issue1524

classification
Title: Dictionary order
Type: behaviour Severity: normal
Components: Core Versions: 2.5.0
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: pjenvey, ssteiner
Priority: Keywords:

Created on 2009-12-14.15:58:56 by ssteiner, last changed 2009-12-15.02:55:23 by pjenvey.

Messages
msg5381 (view) Author: simon steiner (ssteiner) Date: 2009-12-14.15:58:55
a = {}
a['i2'] = 1
a['i'] = 2
print a

jython: {'i2': 1, 'i': 2}
cpython: {'i': 2, 'i2': 1}
msg5383 (view) Author: Philip Jenvey (pjenvey) Date: 2009-12-15.02:55:23
Not a bug, Python dict ordering is arbitrary, the exact ordering is an 
implementation detail. Use an OrderedDict if you need a specific ordering
History
Date User Action Args
2009-12-15 02:55:23pjenveysetstatus: open -> closed
resolution: invalid
messages: + msg5383
nosy: + pjenvey
2009-12-14 16:00:49ssteinersettype: behaviour
2009-12-14 15:58:56ssteinercreate