Sets of instances
<p>I'm trying to build a set of instances of an object, however adding instances of certain objects results in a <code>TypeError: unhashable instance</code>. Here is a minimal example:</p>

<pre><code>from sets import Set
import random
from UserDict import DictMixin

class Item1(object):
    pass

class Item2(DictMixin):
    pass

item_collection = Set()

x = Item1()
y = Item2()

item_collection.add(x) # this works
print item_collection
item_collection.add(y) # this does not
print item_collection
</code></pre>

<p>Why does that fail and how can I get a set of instances of an object derived from DictMixin?</p>
