Skip to content

Commit bae3f4f

Browse files
author
quantmind
committed
more python 3 changes
1 parent 2064f07 commit bae3f4f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

stdnet/backends/structures/base.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,6 @@ def add(self, value):
288288
self.pipeline.add((value.score(),self.pickler.dumps(value)))
289289

290290

291-
def itemcmp(x,y):
292-
if x[0] > y[0]:
293-
return 1
294-
else:
295-
return -1
296-
297-
298291
class KeyValueStructure(Structure):
299292
'''Base class for :class:`HashTable`'''
300293
def __init__(self, *args, **kwargs):
@@ -401,7 +394,7 @@ def sortedkeys(self, desc = True):
401394
return keys
402395

403396
def sorteditems(self, desc = True):
404-
items = sorted(self.items(),cmp = itemcmp)
397+
items = sorted(self.items(),key = lambda t : t[0])
405398
if not desc:
406399
items = reversed(items)
407400
return items

0 commit comments

Comments
 (0)