Paolino wrote:
> I thought rewriting __hash__ should be enough to avoid mutables problem 
> but:
> 
> class H(set):
>   def __hash__(self)
>     return id(self)
> 
> s=H()
> 
> f=set()
> 
> f.add(s)
> f.remove(s)
> 
> the add succeeds
> the remove fails eventually not calling hash(s).

Why don't you just use "frozenset"?

-- 
Ciao,
Matteo
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to