Kill reduce(). A coproduction of John Reese, Jacques Frechet, and Alex M.

This commit is contained in:
Guido van Rossum 2006-08-22 00:21:25 +00:00
parent 6cefeb0e81
commit 89da5d7c3d
10 changed files with 25 additions and 144 deletions

View file

@ -77,7 +77,9 @@ class TestBasicOps(unittest.TestCase):
pop = range(n)
trials = 10000 # large num prevents false negatives without slowing normal case
def factorial(n):
return reduce(int.__mul__, xrange(1, n), 1)
if n == 0:
return 1
return n * factorial(n - 1)
for k in xrange(n):
expected = factorial(n) // factorial(n-k)
perms = {}