summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-22 00:21:25 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-22 00:21:25 (GMT)
commit89da5d7c3d9cf5bfd4a374e23fd924bbffdeaf5c (patch)
treeaef767c70a3b57c4128d44816e4e070d28fffb9d /Tools
parent6cefeb0e8156406ac3f99248f6a3d3cd1536ca23 (diff)
downloadcpython-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 'Tools')
-rwxr-xr-xTools/i18n/pygettext.py4
-rwxr-xr-xTools/pybench/pybench.py4
2 files changed, 3 insertions, 5 deletions
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py
index bb0dd35..eadd149 100755
--- a/Tools/i18n/pygettext.py
+++ b/Tools/i18n/pygettext.py
@@ -462,12 +462,10 @@ class TokenEater:
rentries = reverse[rkey]
rentries.sort()
for k, v in rentries:
- isdocstring = 0
# If the entry was gleaned out of a docstring, then add a
# comment stating so. This is to aid translators who may wish
# to skip translating some unimportant docstrings.
- if reduce(operator.__add__, v.values()):
- isdocstring = 1
+ isdocstring = any(v.values())
# k is the message string, v is a dictionary-set of (filename,
# lineno) tuples. We want to sort the entries in v first by
# file name and then by line number.
diff --git a/Tools/pybench/pybench.py b/Tools/pybench/pybench.py
index 7d90ba1..370175a 100755
--- a/Tools/pybench/pybench.py
+++ b/Tools/pybench/pybench.py
@@ -370,7 +370,7 @@ class Test:
if runs == 0:
return 0.0, 0.0, 0.0, 0.0
min_time = min(self.times)
- total_time = reduce(operator.add, self.times, 0.0)
+ total_time = sum(self.times)
avg_time = total_time / float(runs)
operation_avg = total_time / float(runs
* self.rounds
@@ -570,7 +570,7 @@ class Benchmark:
if runs == 0:
return 0.0, 0.0
min_time = min(self.roundtimes)
- total_time = reduce(operator.add, self.roundtimes, 0.0)
+ total_time = sum(self.roundtimes)
avg_time = total_time / float(runs)
max_time = max(self.roundtimes)
return (min_time, avg_time, max_time)