diff --git a/direct/src/showbase/LazySort.py b/direct/src/showbase/LazySort.py index 9f8a45050b..f0b95f5c38 100755 --- a/direct/src/showbase/LazySort.py +++ b/direct/src/showbase/LazySort.py @@ -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