Simplifies __ne__ in BaseModel

This change uses 'not __eq__' to implement __ne__ preventing
execeptions from being raised when obj passed in does not have
__dict__. Example are instances of tuple, string, int, float,
bool...

Change-Id: Idf82eeeb865a121d5c81c5654e7c21e71e555238
This commit is contained in:
Nathan Buckner 2016-04-13 15:18:04 -05:00
parent 57ad10c550
commit 67353ed226
1 changed files with 1 additions and 7 deletions

View File

@ -141,13 +141,7 @@ class BaseModel(object):
return False
def __ne__(self, obj):
if obj is None:
return True
if vars(obj) == vars(self):
return False
else:
return True
return not self.__eq__(obj)
def __str__(self):
strng = '<{0} object> {1}'.format(