diff options
author | Robert Schuppenies <okkotonushi@googlemail.com> | 2009-05-17 17:32:20 +0000 |
---|---|---|
committer | Robert Schuppenies <okkotonushi@googlemail.com> | 2009-05-17 17:32:20 +0000 |
commit | 926b28e3a1eeee2d0b6435135ce860b78a317e4e (patch) | |
tree | 7efa4ea8ac1c62ae05951723eef3ff9e937f9f5e /Lib/_weakrefset.py | |
parent | ec0a59af028da56ec9b91cb04bd15597321b2c10 (diff) | |
download | cpython-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.py | 2 |
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): |