fixed small but crucial cmp test bug when repopulating the stack
This commit is contained in:
parent
271c7fa858
commit
91b0e85f17
|
|
@ -103,24 +103,25 @@ def itersorted(iterable, cmp = cmp, key = lambda x: x, reverse = False):
|
|||
yield val
|
||||
pass
|
||||
|
||||
def test():
|
||||
import random
|
||||
from itertools import islice
|
||||
|
||||
control = sorted(data, key = lambda x: x[0])
|
||||
variable = itersorted(data, key = lambda x: x[0])
|
||||
|
||||
print control[:10] == [x for x in islice(variable,10)]
|
||||
print data
|
||||
print control
|
||||
|
||||
variable = itersorted(data, key = lambda x: x[0])
|
||||
print [x for x in islice(variable,10)]
|
||||
if __debug__:
|
||||
def P(i):
|
||||
for x in reversed(i):
|
||||
print x
|
||||
|
||||
def test():
|
||||
import random
|
||||
from itertools import islice
|
||||
|
||||
control = sorted(data, key = lambda x: x[0])
|
||||
variable = itersorted(data, key = lambda x: x[0])
|
||||
|
||||
print control[:10] == [x for x in islice(variable,10)]
|
||||
print data
|
||||
print control
|
||||
|
||||
variable = itersorted(data, key = lambda x: x[0])
|
||||
print [x for x in islice(variable,10)]
|
||||
|
||||
from unittest import TestCase, main
|
||||
from random import shuffle
|
||||
from itertools import islice
|
||||
|
|
|
|||
Loading…
Reference in New Issue