Add __ne__ method to bson/objectid.py

This commit is contained in:
Chris Tompkinson 2012-04-12 15:12:47 +01:00
parent 3cb007ee2d
commit 80e59ddd15

View File

@ -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