Issue #0002175: Change type() expressions to isinstance() expressions.
Patch from Gerald Britton <gerald.britton@gmail.com> svn: r10762
This commit is contained in:
@@ -612,7 +612,7 @@ class SimpleAccess:
|
||||
@rtype: list
|
||||
"""
|
||||
assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, NoneType)))
|
||||
assert(type(restrict) == type([]) or restrict == None)
|
||||
assert(isinstance(restrict, list) or restrict == None)
|
||||
|
||||
if obj:
|
||||
event_handles = [ ref.ref for ref in obj.get_event_ref_list() ]
|
||||
|
@@ -179,9 +179,9 @@ class SimpleTable:
|
||||
for col in range(len(data)):
|
||||
item = data[col]
|
||||
# FIXME: add better text representations of these objects
|
||||
if type(item) in [str, unicode]:
|
||||
if isinstance(item, basestring):
|
||||
retval.append(item)
|
||||
elif type(item) in [int, float, long]:
|
||||
elif isinstance(item, (int, float, long)):
|
||||
retval.append(item)
|
||||
self.row_sort_val(col, item)
|
||||
elif isinstance(item, gen.lib.Person):
|
||||
|
Reference in New Issue
Block a user