mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects.
This commit is contained in:
parent
441efa8955
commit
4ad1d6f81a
2 changed files with 15 additions and 10 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue