title: Dict/Set Parsing Order Consistency
body: <p>Containers that take hashable objects (such as <code>dict</code> keys or <code>set</code> items). As such, a dictionary can only have one key with the value <code>1</code>, <code>1.0</code> or <code>True</code> etc. (note: simplified somewhat - hash collisions are permitted, but these values are considered equal)</p>
  
  <p>My question is: is the parsing order well-defined and is the resulting object predictable across implementations? For example, OSX Python 2.7.11  and 3.5.1 interprets <code>dict</code> like so:</p>
  
  <pre><code>&gt;&gt;&gt; { True: 'a', 1: 'b', 1.0: 'c', (1+0j): 'd' }
  {True: 'd'}
  </code></pre>
  
  <p>In this case, it appears that the first key and the last value are preserved.</p>
  
  <p>Similar, in the case of <code>set</code>:</p>
  
  <pre><code>&gt;&gt;&gt; { True, 1, 1.0, (1+0j) }
  set([(1+0j)])
  </code></pre>
  
  <p>Here it appears that the <em>last</em> item is preserved.</p>
  
  <p>But (as mentioned in comments):</p>
  
  <pre><code>&gt;&gt;&gt; set([True, 1, 1.0])
  set([True])
  </code></pre>
  
  <p>Now the first in the iterable is preserved.</p>
  
  <p>The documentation notes that the order of items (for example in <code>dict.items</code>) is undefined, however my question refers to the result of <em>constructing</em> <code>dict</code> or <code>set</code> objects.</p>