Commit e9a0c154 authored by Andreas Jung's avatar Andreas Jung

some cleanup

parent 8084c378
...@@ -109,7 +109,7 @@ class UnIndex(SimpleItem): ...@@ -109,7 +109,7 @@ class UnIndex(SimpleItem):
""" """
histogram = {} histogram = {}
for item in self._index.items(): for item in self._index.items():
if type(item) is IntType: if isinstance(item,int):
entry = 1 # "set" length is 1 entry = 1 # "set" length is 1
else: else:
key, value = item key, value = item
...@@ -343,18 +343,18 @@ class UnIndex(SimpleItem): ...@@ -343,18 +343,18 @@ class UnIndex(SimpleItem):
setlist = index.items(lo) setlist = index.items(lo)
for k, set in setlist: for k, set in setlist:
if type(set) is IntType: if isinstance(set, int):
set = IISet((set,)) set = IISet((set,))
r = set_func(r, set) r = set_func(r, set)
else: # not a range search else: # not a range search
for key in record.keys: for key in record.keys:
set=index.get(key, None) set=index.get(key, None)
if set is not None: if set is not None:
if type(set) is IntType: if isinstance(set, int):
set = IISet((set,)) set = IISet((set,))
r = set_func(r, set) r = set_func(r, set)
if type(r) is IntType: r=IISet((r,)) if isinstance(r, int): r=IISet((r,))
if r is None: if r is None:
return IISet(), (self.id,) return IISet(), (self.id,)
else: else:
...@@ -395,7 +395,7 @@ class UnIndex(SimpleItem): ...@@ -395,7 +395,7 @@ class UnIndex(SimpleItem):
rl=[] rl=[]
for i in self._index.keys(): for i in self._index.keys():
set = self._index[i] set = self._index[i]
if type(set) is IntType: if isinstance(set, int):
l = 1 l = 1
else: else:
l = len(set) l = len(set)
...@@ -412,7 +412,7 @@ class UnIndex(SimpleItem): ...@@ -412,7 +412,7 @@ class UnIndex(SimpleItem):
def items(self): def items(self):
items = [] items = []
for k,v in self._index.items(): for k,v in self._index.items():
if type(v) is IntType: if isinstance(v, int):
v = IISet((v,)) v = IISet((v,))
items.append((k, v)) items.append((k, v))
return items return items
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment