summaryrefslogtreecommitdiff
path: root/Lib/_weakrefset.py
diff options
context:
space:
mode:
authorRobert Schuppenies <okkotonushi@googlemail.com>2009-05-17 17:32:20 +0000
committerRobert Schuppenies <okkotonushi@googlemail.com>2009-05-17 17:32:20 +0000
commit926b28e3a1eeee2d0b6435135ce860b78a317e4e (patch)
tree7efa4ea8ac1c62ae05951723eef3ff9e937f9f5e /Lib/_weakrefset.py
parentec0a59af028da56ec9b91cb04bd15597321b2c10 (diff)
downloadcpython-926b28e3a1eeee2d0b6435135ce860b78a317e4e.tar.gz
Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects.
Diffstat (limited to 'Lib/_weakrefset.py')
-rw-r--r--Lib/_weakrefset.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py
index 0046133925..addc7afeef 100644
--- a/Lib/_weakrefset.py
+++ b/Lib/_weakrefset.py
@@ -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):