From 89da5d7c3d9cf5bfd4a374e23fd924bbffdeaf5c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 22 Aug 2006 00:21:25 +0000 Subject: Kill reduce(). A coproduction of John Reese, Jacques Frechet, and Alex M. --- Lib/test/test_random.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_random.py') diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index bba4c7cf8ba..afcf113564d 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -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 = {} -- cgit v1.2.3