mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Kill reduce(). A coproduction of John Reese, Jacques Frechet, and Alex M.
This commit is contained in:
parent
6cefeb0e81
commit
89da5d7c3d
10 changed files with 25 additions and 144 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue