nope.  Here I use the trick that for most ints, hash(i) == i to quickly find two values with the same hash and put them in a dict.<p><pre><code>    &gt;&gt;&gt; k1 = &quot;foo&quot;
    &gt;&gt;&gt; k2 = hash(k1)
    &gt;&gt;&gt; hash(k1) == hash(k2)
    True
    &gt;&gt;&gt; d = {k1: &quot;v1&quot;, k2: &quot;v2&quot;}
    &gt;&gt;&gt; d[k1]
    &#x27;v1&#x27;
    &gt;&gt;&gt; d[k2]
    &#x27;v2&#x27;
</code></pre>
Now that I&#x27;ve been pedantic, I hope I get this right: in Python, it is equality (==) that defines same-ness for dicts and sets.  But if x == y, then you have to ensure that hash(x) == hash(y).  Python uses this characteristic to make the initial check for dict and set membership integer comparisons on the hash, but when two items have the same hash, Python goes on to distinguish them on the basis of equality.