aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/GeneralObject.py
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-19 02:31:31 +0300
committerBonfaceKilz2020-08-19 02:34:42 +0300
commitba123e1e0fe693f9778993c3f8e5a70a28658a4c (patch)
tree6d02bac212da1bfeeb8330b94971383cde053602 /wqflask/base/GeneralObject.py
parentbafbb5b7a4b7db2ca230f292eb45be7e67985259 (diff)
downloadgenenetwork2-ba123e1e0fe693f9778993c3f8e5a70a28658a4c.tar.gz
Fix dictionary iteration methods
Run `2to3-3.8 -f dict -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-dict> and <https://stackoverflow.com/questions/17695456/why-does-python-3-need-dict-items-to-be-wrapped-with-list>
Diffstat (limited to 'wqflask/base/GeneralObject.py')
-rw-r--r--wqflask/base/GeneralObject.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py
index 0fccaab3..707569db 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,16 @@ 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()))
+ return len(list(self.__dict__.keys())).__cmp__(len(list(other.__dict__.keys())))