summaryrefslogtreecommitdiffstats
path: root/Lib/difflib.py
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 /Lib/difflib.py
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 'Lib/difflib.py')
-rw-r--r--Lib/difflib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 7ab682d..408079b 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -652,8 +652,7 @@ class SequenceMatcher:
1.0
"""
- matches = reduce(lambda sum, triple: sum + triple[-1],
- self.get_matching_blocks(), 0)
+ matches = sum(triple[-1] for triple in self.get_matching_blocks())
return _calculate_ratio(matches, len(self.a) + len(self.b))
def quick_ratio(self):