set of sets

Paolino paolo_veronelli at tiscali.it
Thu Aug 11 06:47:54 EDT 2005


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).


Thanks for help

Paolino

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



More information about the Python-list mailing list