@@ -53,8 +53,8 @@ \section{\module{difflib} ---
5353 \strong {Timing:} The basic Ratcliff-Obershelp algorithm is cubic
5454 time in the worst case and quadratic time in the expected case.
5555 \class {SequenceMatcher} is quadratic time for the worst case and has
56- expected-case behavior dependent on how many elements the sequences
57- have in common; best case time (no elements in common) is linear.
56+ expected-case behavior dependent in a complicated way on how many
57+ elements the sequences have in common; best case time is linear.
5858\end {classdesc }
5959
6060
@@ -68,6 +68,9 @@ \subsection{SequenceMatcher Objects \label{sequence-matcher}}
6868 \code {None} is equivalent to passing \code {lambda x: 0}, i.e.\ no
6969 elements are ignored. For example, pass
7070
71+ % BUG: the HTML generated for this is
72+ % BUG: lambda x: x in " \\t"
73+ % BUG: i.e. it displays two backslashes.
7174\begin {verbatim }
7275lambda x: x in " \\t"
7376\end {verbatim }
@@ -138,7 +141,7 @@ \subsection{SequenceMatcher Objects \label{sequence-matcher}}
138141 junk happens to be adjacent to an interesting match.
139142
140143 Here's the same example as before, but considering blanks to be junk.
141- That prevents \code {' abcd'} from matching the \code { abcd} at the
144+ That prevents \code {' abcd'} from matching the \code {' abcd' } at the
142145 tail end of the second sequence directly. Instead only the
143146 \code {'abcd'} can match, and matches the leftmost \code {'abcd'} in
144147 the second sequence:
@@ -217,8 +220,8 @@ \subsection{SequenceMatcher Objects \label{sequence-matcher}}
217220 range [0, 1].
218221
219222 Where T is the total number of elements in both sequences, and M is
220- the number of matches, this is 2, 0*M / T. Note that this is \code {1}
221- if the sequences are identical, and \code {0} if they have nothing in
223+ the number of matches, this is 2. 0*M / T. Note that this is \code {1. }
224+ if the sequences are identical, and \code {0. } if they have nothing in
222225 common.
223226
224227 This is expensive to compute if \method {get_matching_blocks()} or
@@ -242,8 +245,10 @@ \subsection{SequenceMatcher Objects \label{sequence-matcher}}
242245 \method {ratio()} or \method {quick_ratio()}.
243246\end {methoddesc }
244247
245- The three methods that return the ratio of differences to similarities
246- can give different results due to differing levels of approximation:
248+ The three methods that return the ratio of matching to total characters
249+ can give different results due to differing levels of approximation,
250+ although \method {quick_ratio()} and \method {real_quick_ratio()} are always
251+ at least as large as \method {ratio()}:
247252
248253\begin {verbatim }
249254>>> s = SequenceMatcher(None, "abcd", "bcde")
0 commit comments