title: Can I safely use hashes of tuples containing 64 bit integers (longs) as unique keys in a python dictionary?
body: <p>I have to store objects that have two attributes (ida and idb) inside a dict. Both attributes are 64 bit positive integers and I can only store one object for a unique arrangement(combination in which the order matters) of ida and idb. For example:</p>
  
  <pre><code>obj1 = SomeClass(ida=5223372036854775807, idb=2)
  obj2 = SomeClass(ida=2, idb=5223372036854775807)
  obj3 = SomeClass(ida=5223372036854775807, idb=2)
  </code></pre>
  
  <p>Since the objects themselves are mutable, I'm using hashes of tuples '(ida, idb,)' as keys. Following the example, consider this:</p>
  
  <pre><code>d = {}
  # storing obj1
  k1 = hash((obj1.ida, obj1.idb,))
  d[k1] = obj1
  # storing obj2
  k2 = hash((obj2.ida, obj2.idb,))
  d[k2] = obj2
  # storing obj3
  k3 = hash((obj3.ida, obj3.idb,)) # note that k3 hash should be the same as k1
  d[k3] = obj3
  #at this point 'd' should contain only 'obj2' and 'obj3' since 'k1' == 'k3'
  </code></pre>
  
  <p>I tested the above example in my 64 bit machine and it worked as expected.</p>
  
  <p>I have the following questions: </p>
  
  <ul>
  <li>Is it possible for two tuples of big integers to compute the same hash if they have differences either in elements or in ordering?</li>
  <li>What about in 32 bit platforms?</li>
  <li>If not, is there a platform independent way to guarantee that the above example will work no matter the values of ida and idb?</li>
  </ul>