diff options
author | Guido van Rossum <guido@python.org> | 2006-08-22 00:21:25 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-22 00:21:25 (GMT) |
commit | 89da5d7c3d9cf5bfd4a374e23fd924bbffdeaf5c (patch) | |
tree | aef767c70a3b57c4128d44816e4e070d28fffb9d /Lib/test/test_random.py | |
parent | 6cefeb0e8156406ac3f99248f6a3d3cd1536ca23 (diff) | |
download | cpython-89da5d7c3d9cf5bfd4a374e23fd924bbffdeaf5c.zip cpython-89da5d7c3d9cf5bfd4a374e23fd924bbffdeaf5c.tar.gz cpython-89da5d7c3d9cf5bfd4a374e23fd924bbffdeaf5c.tar.bz2 |
Kill reduce(). A coproduction of John Reese, Jacques Frechet, and Alex M.
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r-- | Lib/test/test_random.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index bba4c7c..afcf113 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 = {} |