Implement __ne__ for MangedObject
As per python docs, "There are no implied relationships among the comparison operators. The truth of x==y does not imply that x!=y is false. Accordingly, when defining __eq__(), one should also define __ne__() so that the operators will behave as expected" Hence, implementing __ne__ to enable '!='
This commit is contained in:
		| @@ -465,6 +465,9 @@ class ManagedObject(object): | ||||
|                 self.__class__ == other.__class__ and \ | ||||
|                 self._serverGuid == other._serverGuid | ||||
|  | ||||
|    def __ne__(self, other): | ||||
|       return not(self == other) | ||||
|  | ||||
|    def __hash__(self): | ||||
|       return str(self).__hash__() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tianhao He
					Tianhao He