Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects.
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 @@
         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):