fixed small but crucial cmp test bug when repopulating the stack

This commit is contained in:
Josh Wilson 2007-08-26 09:41:39 +00:00
parent 271c7fa858
commit 91b0e85f17
1 changed files with 14 additions and 13 deletions

View File

@ -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