From 80e59ddd15c6b53734ded503f66734742d4450b3 Mon Sep 17 00:00:00 2001 From: Chris Tompkinson Date: Thu, 12 Apr 2012 15:12:47 +0100 Subject: [PATCH] Add __ne__ method to bson/objectid.py --- bson/objectid.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bson/objectid.py b/bson/objectid.py index 357554fcd..4abf7ca57 100644 --- a/bson/objectid.py +++ b/bson/objectid.py @@ -235,6 +235,11 @@ class ObjectId(object): return self.__id == other.__id return NotImplemented + def __ne__(self,other): + if isinstance(other, ObjectId): + return self.__id != other.__id + return NotImplemented + def __lt__(self, other): if isinstance(other, ObjectId): return self.__id < other.__id