title: Why does the **kwargs mapping compare equal with a differently ordered OrderedDict?
body: <p>According to <a href="https://www.python.org/dev/peps/pep-0468/" rel="nofollow noreferrer">PEP 468</a>:</p>
  
  <blockquote>
    <p>Starting in version 3.6 Python will preserve the order of keyword arguments as passed to a function. To accomplish this the collected <strong>kwargs will now be an ordered mapping</strong>. Note that this does not necessarily mean <code>OrderedDict</code>.</p>
  </blockquote>
  
  <p>In that case, why does this ordered mapping fail to respect equality comparison with Python's canonical ordered mapping type, the <code>collections.OrderedDict</code>:</p>
  
  <pre><code>&gt;&gt;&gt; from collections import OrderedDict
  &gt;&gt;&gt; data = OrderedDict(zip('xy', 'xy'))
  &gt;&gt;&gt; def foo(**kwargs):
  ...     return kwargs == data
  ... 
  &gt;&gt;&gt; foo(x='x', y='y')  # expected result: True
  True
  &gt;&gt;&gt; foo(y='y', x='x')  # expected result: False
  True
  </code></pre>
  
  <p>Although iteration order is now preserved, <code>kwargs</code> seems to be behaving just like a normal dict for the comparisons. Python has a C implemented ordered dict <a href="https://bugs.python.org/issue16991" rel="nofollow noreferrer">since 3.5</a>, so it could conceivably have been used directly (or, if performance was still a concern, a faster implementation using a thin subclass of the 3.6 compact dict).</p>
  
  <p><strong>Why doesn't the ordered mapping received by a function respect ordering in equality comparisons?</strong></p>