This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cool-RR
Recipients cool-RR
Date 2010-09-10.16:15:18
SpamBayes Score 1.1108181e-05
Marked as misclassified No
Message-id <1284135323.35.0.651506099343.issue9823@psf.upfronthosting.co.za>
In-reply-to
Content
OrderedDict is currently comparable to dict.

I think this is not logical, because a dict doesn't have order, and having an identical order is a necessary condition for a match.

I think that comparing an OrderedDict with a dict makes as much sense as comparing a tuple with a set, and that's currently not allowed. (Always returns False)

Here's a disturbing code snippet executed in Python 3.2a1:

>>> from collections import OrderedDict
>>> d1 = OrderedDict(((1, 2), (3, 4)))
>>> d2 = OrderedDict(((3, 4), (1, 2)))
>>> d1 == d2
False
>>> d1 == {1: 2, 3: 4} == d2
True
History
Date User Action Args
2010-09-10 16:15:23cool-RRsetrecipients: + cool-RR
2010-09-10 16:15:23cool-RRsetmessageid: <1284135323.35.0.651506099343.issue9823@psf.upfronthosting.co.za>
2010-09-10 16:15:19cool-RRlinkissue9823 messages
2010-09-10 16:15:18cool-RRcreate