diff options
author | Robert Schuppenies <okkotonushi@googlemail.com> | 2009-05-17 17:32:20 (GMT) |
---|---|---|
committer | Robert Schuppenies <okkotonushi@googlemail.com> | 2009-05-17 17:32:20 (GMT) |
commit | 4ad1d6f81a1fec3b9822e104e5df3a61a5cc328c (patch) | |
tree | f0e22e310ff1577f1f7098498e9d625b90f23363 /Lib/_weakrefset.py | |
parent | 441efa89553c62e4cada101d809b2470fc34a0b8 (diff) | |
download | cpython-4ad1d6f81a1fec3b9822e104e5df3a61a5cc328c.zip cpython-4ad1d6f81a1fec3b9822e104e5df3a61a5cc328c.tar.gz cpython-4ad1d6f81a1fec3b9822e104e5df3a61a5cc328c.tar.bz2 |
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 0046133..addc7af 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): |