<div dir="ltr"><div><div><div>If we put technical considerations aside, maybe we should just ask to ourselves what behavior do we expect when doing equality tests between ordered dictionaries. As a reminder:<br><br>>>> xy = OrderedDict([('x', None), ('y', None)])<br>>>> yx = OrderedDict([('y', None), ('x', None)])<br>>>> xy == yx<br>False<br>>>> xy.items() == yx.items()<br>True<br>>>> xy.keys() == yx.keys()<br>True<br>>>> xy.values() == yx.values()<br>False<br><br>So, it appears that:<br>1. equality tests between odict_values use objects identity and not equality,<br></div>2. equality tests between odict_keys do not respect order.<br><br></div>If it is not technically possible to change the current implementation, maybe all we can do is just add a warning about current behavior in the documentation?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 11, 2016 at 4:17 AM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Seems like we dropped the ball... Is there any action item here?<span class=""><br clear="all"><div class="gmail_extra"><br>-- <br><div>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></span></div>
<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br></blockquote></div><br></div></div>