There was an error while loading. Please reload this page.
1 parent 0e4f79c commit 98af86aCopy full SHA for 98af86a
pymongo/message.py
@@ -232,6 +232,20 @@ def namespace(self):
232
"""The namespace this cursor."""
233
return self.__namespace
234
235
+ def __hash__(self):
236
+ # Two _CursorAddress instances with different namespaces
237
+ # must not hash the same.
238
+ return (self + (self.__namespace,)).__hash__()
239
+
240
+ def __eq__(self, other):
241
+ if isinstance(other, _CursorAddress):
242
+ return (tuple(self) == tuple(other)
243
+ and self.namespace == other.namespace)
244
+ return NotImplemented
245
246
+ def __ne__(self, other):
247
+ return not self == other
248
249
250
def __last_error(namespace, args):
251
"""Data to send to do a lastError.
0 commit comments