Paolo Veronelli wrote:
> Yes this is really strange.
> 
> from sets import Set
> class H(Set):
>   def __hash__(self):
>     return id(self)
> 
> s=H()
> f=set() #or f=Set()
> 
> f.add(s)
> f.remove(s)
> 
> No errors.
> 
> So we had a working implementation of sets in the library an put a 
> broken one in the __builtins__ :(
> 
> Should I consider it a bug ?

Looks like the builtin "set" implicitly converts sets arguments to 
remove to frozensets. That way, remove looks for "frozenset()" instead 
of "H()", so it won't work. Doesn't look like a documented behaviour to 
me, though.

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

Reply via email to