Index: _weakrefset.py =================================================================== --- _weakrefset.py (revision 72555) +++ _weakrefset.py (working copy) @@ -2,6 +2,7 @@ # This code is separated-out because it is needed # by abc.py to load everything else at startup. +import _abcoll from _weakref import ref __all__ = ['WeakSet'] @@ -118,6 +119,8 @@ return self.data >= set(ref(item) for item in other) def __eq__(self, other): + if not isinstance(other, _abcoll.Iterable): + return False return self.data == set(ref(item) for item in other) def symmetric_difference(self, other):