On Sun, 13 Dec 2009 17:19:17 -0800, knifenomad wrote:
> this makes the set type hashable. > > class Set(set): > __hash__ = lambda self: id(self) That's a *seriously* broken hash function. >>> key = "voila" >>> d = { Set(key): 1 } >>> d {Set(['i', 'a', 'l', 'o', 'v']): 1} >>> d[ Set(key) ] Traceback (most recent call last): File "<stdin>", line 1, in <module> KeyError: Set(['i', 'a', 'l', 'o', 'v']) -- Steven -- http://mail.python.org/mailman/listinfo/python-list