aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/GeneralObject.py
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-26 18:51:54 +0300
committerBonfaceKilz2020-08-26 19:01:56 +0300
commit7717f0d3d4802d115a8b5ace4d379864ba5b1188 (patch)
treed322f1fc471d183c4fa170bc5bd5e422b2900439 /wqflask/base/GeneralObject.py
parent94f97127a9e451c7adb36613d090a612601b9d01 (diff)
downloadgenenetwork2-7717f0d3d4802d115a8b5ace4d379864ba5b1188.tar.gz
Replace "__cmp__" with "__eq__" magic method
* wqflask/base/GeneralObject.py: "__cmp__" is no longer used in python3. See: <https://stackoverflow.com/questions/8276983/why-cant-i-use-the-method-cmp-in-python-3-as-for-python-2>
Diffstat (limited to 'wqflask/base/GeneralObject.py')
-rw-r--r--wqflask/base/GeneralObject.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py
index 707569db..0122ee32 100644
--- a/wqflask/base/GeneralObject.py
+++ b/wqflask/base/GeneralObject.py
@@ -61,5 +61,6 @@ class GeneralObject:
s += '%s = %s\n' % (key, self.__dict__[key])
return s
- def __cmp__(self, other):
- return len(list(self.__dict__.keys())).__cmp__(len(list(other.__dict__.keys())))
+ def __eq__(self, other):
+ return (len(list(self.__dict__.keys())) ==
+ len(list(other.__dict__.keys())))