[Python-ideas] Fwd: Why do equality tests between OrderedDict keys/values views behave not as expected?

Alexandre Figura ipipomme+python at gmail.com
Thu Dec 17 04:40:33 EST 2015


I recently compared OrderedDict instances while writing unit tests, and
discovered an interesting behavior. If I create two ordered dictionaries
with the same keys/values in the same order, I observe that their values
are not equal when I compare them.

I recently asked a question about this on Stackoverflow:

Moreover, another user observed that keys of ordered dictionaries are
compared in an order insensitive way:

Are there any reasons for such implementation choices? As it appears
disturbing for many people, would it be possible to update these behaviors?

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151217/2c7d2db6/attachment-0001.html>

More information about the Python-ideas mailing list