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 vajrasky
Recipients ezio.melotti, michael.foord, pitrou, rhettinger, serhiy.storchaka, terry.reedy, vajrasky
Date 2013-06-09.12:58:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1370782708.82.0.299216803147.issue18106@psf.upfronthosting.co.za>
In-reply-to
Content
Fixed the test based on Ezio Melotti's advice.

However, Ezio did not comment specifically about whether we should cut or keep this line.

self.assertEqual(list(dup.items()), list(od.items()))

After studying the OrderedDict source code, I came to conclusion that if "self.assertEqual(dup, od)" is true, so is "self.assertEqual(list(dup.items()), list(od.items()))".

But if "self.assertEqual(dup, od)" is false, so is "self.assertEqual(list(dup.items()), list(od.items()))".

This is how OrderedDict tests the equality:

    def __eq__(self, other):
        if isinstance(other, OrderedDict):
            return dict.__eq__(self, other) and all(map(_eq, self, other))
        return dict.__eq__(self, other)

So I think it should be safe to remove:

self.assertEqual(list(dup.items()), list(od.items()))
History
Date User Action Args
2013-06-09 12:58:28vajraskysetrecipients: + vajrasky, rhettinger, terry.reedy, pitrou, ezio.melotti, michael.foord, serhiy.storchaka
2013-06-09 12:58:28vajraskysetmessageid: <1370782708.82.0.299216803147.issue18106@psf.upfronthosting.co.za>
2013-06-09 12:58:28vajraskylinkissue18106 messages
2013-06-09 12:58:28vajraskycreate