set of sets
della at toglimi.linux.it
Fri Aug 12 08:45:02 CEST 2005
Paolo Veronelli wrote:
> Yes this is really strange.
> from sets import Set
> class H(Set):
> def __hash__(self):
> return id(self)
> f=set() #or f=Set()
> 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
More information about the Python-list