Skip to content

Commit f07748a

Browse files
committed
flake8: E721 do not compare types, use 'isinstance()'
1 parent 6dae015 commit f07748a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

roundup/cgi/templating.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,14 +1162,14 @@ def history(self, direction='descending', dre=re.compile(r'^\d+$'),
11621162
for id, evt_date, user, action, args in history:
11631163
date_s = str(evt_date.local(timezone)).replace("."," ")
11641164
arg_s = ''
1165-
if action in ['link', 'unlink'] and type(args) == type(()):
1165+
if action in ['link', 'unlink'] and isinstance(args, tuple):
11661166
if len(args) == 3:
11671167
linkcl, linkid, key = args
11681168
arg_s += '<a rel="nofollow noopener" href="%s%s">%s%s %s</a>'%(linkcl, linkid,
11691169
linkcl, linkid, key)
11701170
else:
11711171
arg_s = str(args)
1172-
elif type(args) == type({}):
1172+
elif isinstance(args, dict):
11731173
cell = []
11741174
for k in args.keys():
11751175
# try to get the relevant property and treat it
@@ -3252,7 +3252,7 @@ def add(k, v):
32523252
for k,v in self.filterspec.items():
32533253
if k in exclude:
32543254
continue
3255-
if type(v) == type([]):
3255+
if isinstance(v, list):
32563256
# id's are stored as strings but should be treated
32573257
# as integers in lists.
32583258
if (isinstance(cls.get_transitive_prop(k), hyperdb.String)
@@ -3324,7 +3324,7 @@ def indexargs_url(self, url, args):
33243324
cls = self.client.db.getclass(self.classname)
33253325
for k,v in self.filterspec.items():
33263326
if k not in args:
3327-
if type(v) == type([]):
3327+
if isinstance(v, list):
33283328
prop = cls.get_transitive_prop(k)
33293329
if k != 'id' and isinstance(prop, hyperdb.String):
33303330
l.append('%s=%s'%(k, '%20'.join([q(i) for i in v])))

0 commit comments

Comments
 (0)