diff options
author | BonfaceKilz | 2020-10-27 01:18:38 +0300 |
---|---|---|
committer | GitHub | 2020-10-27 01:18:38 +0300 |
commit | 37c391bc62e9080effcf83c6ff0056ab8841b7fb (patch) | |
tree | 1e794c5616c25e82869314a2f4e91f64c4d40ea9 /wqflask/base/GeneralObject.py | |
parent | 85896707ef1f9e214b45298f6b5b1a9dc37bc839 (diff) | |
parent | b369489e6c075eee3f58bb33e493c901b052b0a1 (diff) | |
download | genenetwork2-37c391bc62e9080effcf83c6ff0056ab8841b7fb.tar.gz |
Merge pull request #422 from BonfaceKilz/build/python3-migration
Build/python3 migration
Diffstat (limited to 'wqflask/base/GeneralObject.py')
-rw-r--r-- | wqflask/base/GeneralObject.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py index 0fccaab3..0122ee32 100644 --- a/wqflask/base/GeneralObject.py +++ b/wqflask/base/GeneralObject.py @@ -33,7 +33,7 @@ class GeneralObject: def __init__(self, *args, **kw): self.contents = list(args) - for name, value in kw.items(): + for name, value in list(kw.items()): setattr(self, name, value) def __setitem__(self, key, value): @@ -50,16 +50,17 @@ class GeneralObject: def __str__(self): s = '' - for key in self.__dict__.keys(): + for key in list(self.__dict__.keys()): if key != 'contents': s += '%s = %s\n' % (key, self.__dict__[key]) return s def __repr__(self): s = '' - for key in self.__dict__.keys(): + for key in list(self.__dict__.keys()): s += '%s = %s\n' % (key, self.__dict__[key]) return s - def __cmp__(self, other): - return len(self.__dict__.keys()).__cmp__(len(other.__dict__.keys())) + def __eq__(self, other): + return (len(list(self.__dict__.keys())) == + len(list(other.__dict__.keys()))) |