Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
difflib.py: grammar
  • Loading branch information
pulkin authored May 17, 2024
commit a159954afc78d44ba18a172eb845fdc84cc894e1
8 changes: 4 additions & 4 deletions Lib/difflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,13 +917,13 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):

max_len_a = max(map(len, a))
max_len_b = max(map(len, b))
# twice epsilon can be safely added to distinguish equal ratios
# given ratios are 2 * integer / (len_i + len_j)
# twice the epsilon can be safely added to distinguish otherwise
# equal ratios. given ratios are 2 * integer / (len_i + len_j)
# the smallest possible non-zero difference between two arbitrary
# ratios is no less than twice the epsilon
epsilon = 0.99 / (max_len_a + max_len_b) ** 2
# we use sub-epsilon weights to promote otherwise equal ratios
# that split sequences closer to their midpoints
# we use sub-epsilon weights to promote i, j that split the
# input range more equally.
# this way, we balance the recursion tree in degenerate cases

# search for the pair that matches best without being identical
Expand Down