title: Python set class, float and int evaluation
body: <p>I have not seen the implementation details of the <code>set Class</code> but I assume the answer to this is there somewhere. Python assignment basically evaluates rvalues and uses an identifier as reference object to point to the class object. Same for collections, i.e. they are an abstract data structure or a 'collection' of reference object. Sets don't allow duplicates and when I create a set like so:</p>
  
  <pre><code>s1 = {False, 1.0, 1, "a"} &gt; {False, 1.0, "a"}
  </code></pre>
  
  <p>Float class wins over int class, obviously they evaluate to the same thing. But why does float show and init doesn't? I can't seem to find a decent answer or see it in the source.</p>
  
  <p>As an aside I'd like to mention I noticed that True and False will be usurped in some way in place of 1 and 0 respectively if both are present using a .union() operation. So Floats win over Ints, and Ints win over Bools it would seem. But, </p>
  
  <pre><code>&gt;&gt;&gt; s1 = {False, 'a', 1}
  &gt;&gt;&gt; s2 = {True, 'a', 0}
  
  &gt;&gt;&gt; s1 | s2
  {False, 1, 'a'} 
  </code></pre>
  
  <p>False remains.. <strong>I don't</strong> know if this was a REPL issue but after testing this again I get <code>{0, 1, 'a'}</code> every time I don't know what happened.</p>
  
  <pre><code>&gt;&gt;&gt; s1 = {True, 'a', 1}
  &gt;&gt;&gt; s1
  {1, 'a'}
  &gt;&gt;&gt; s2 = {False, 'a', 0}
  &gt;&gt;&gt; s2
  {0, 'a'}
  </code></pre>
  
  <p>What am I missing?</p>
  
  <pre><code>&gt;&gt;&gt; s1.union(s2)
  {0, 1, 'a'}
  </code></pre>