[issue16627] comparison problem of two 'dict' objects

2012-12-06 Thread Ezio Melotti
Ezio Melotti added the comment: That's because dicts are not ordered. You might want to use collections.OrderedDict if the order matters to you. -- nosy: +ezio.melotti resolution: -> invalid stage: -> committed/rejected status: open -> closed ___

[issue16627] comparison problem of two 'dict' objects

2012-12-06 Thread Singer Song
New submission from Singer Song: #python code: a={600072:1, 8880:2, 600243:3, 600495:4, 80002529:5} b={600072:1, 8880:2, 600243:3, 80002529:5, 600495:4} print(a) print(b) print(a==b) print(str(a)==str(b)) print(a.keys()==b.keys()) #output in python2.7.3: {600072: 1, 8880: 2, 600243: