Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects.

This commit is contained in:
Robert Schuppenies 2009-05-17 17:32:20 +00:00
parent 441efa8955
commit 4ad1d6f81a
2 changed files with 15 additions and 10 deletions

View file

@ -118,6 +118,8 @@ class WeakSet:
return self.data >= set(ref(item) for item in other)
def __eq__(self, other):
if not isinstance(other, self.__class__):
return NotImplemented
return self.data == set(ref(item) for item in other)
def symmetric_difference(self, other):