@@ -195,7 +195,7 @@ Diff generation
195195 .. method :: make_file(fromlines, tolines, fromdesc='', todesc='', context=False, \
196196 numlines=5, *, charset='utf-8')
197197
198- Compares *fromlines * and *tolines * (lists of strings) and returns a string which
198+ Compares *fromlines * and *tolines * (sequences of strings) and returns a string which
199199 is a complete HTML file containing a table showing line by line differences with
200200 inter-line and intra-line changes highlighted.
201201
@@ -222,7 +222,7 @@ Diff generation
222222
223223 .. method :: make_table(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
224224
225- Compares *fromlines * and *tolines * (lists of strings) and returns a string which
225+ Compares *fromlines * and *tolines * (sequences of strings) and returns a string which
226226 is a complete HTML table showing line by line differences with inter-line and
227227 intra-line changes highlighted.
228228
@@ -233,7 +233,7 @@ Diff generation
233233
234234.. function :: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
235235
236- Compare *a * and *b * (lists of strings); return a delta (a :term: `generator `
236+ Compare *a * and *b * (sequences of strings); return a delta (a :term: `generator `
237237 generating the delta lines) in context diff format.
238238
239239 Context diffs are a compact way of showing just the lines that have changed plus
@@ -306,7 +306,7 @@ Diff generation
306306
307307.. function :: ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK)
308308
309- Compare *a * and *b * (lists of strings); return a :class: `Differ `\ -style
309+ Compare *a * and *b * (sequences of strings); return a :class: `Differ `\ -style
310310 delta (a :term: `generator ` generating the delta lines).
311311
312312 Optional keyword parameters *linejunk * and *charjunk * are filtering functions
@@ -364,7 +364,7 @@ Diff generation
364364
365365.. function :: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n', *, color=False)
366366
367- Compare *a * and *b * (lists of strings); return a delta (a :term: `generator `
367+ Compare *a * and *b * (sequences of strings); return a delta (a :term: `generator `
368368 generating the delta lines) in unified diff format.
369369
370370 Unified diffs are a compact way of showing just the lines that have changed plus
@@ -449,6 +449,32 @@ Junk definition functions
449449
450450.. _sequence-matcher :
451451
452+ .. class :: Match
453+
454+ The type of the objects returned by :meth: `SequenceMatcher.find_longest_match `
455+ and :meth: `SequenceMatcher.get_matching_blocks `. It is an object with a
456+ :term: `named tuple ` interface: values can be accessed by index and by
457+ attribute name. It has the following fields:
458+
459+ .. list-table ::
460+
461+ * - Index
462+ - Attribute
463+ - Value
464+
465+ * - 0
466+ - .. attribute:: a
467+ - The index in the first sequence of the matching block.
468+
469+ * - 1
470+ - .. attribute:: b
471+ - The index in the second sequence of the matching block.
472+
473+ * - 2
474+ - .. attribute:: size
475+ - The number of elements in the matching block.
476+
477+
452478SequenceMatcher objects
453479-----------------------
454480
@@ -513,7 +539,8 @@ SequenceMatcher objects
513539 Find longest matching block in ``a[alo:ahi] `` and ``b[blo:bhi] ``.
514540
515541 If *isjunk * was omitted or ``None ``, :meth: `find_longest_match ` returns
516- ``(i, j, k) `` such that ``a[i:i+k] `` is equal to ``b[j:j+k] ``, where ``alo
542+ a :class: `Match ` named tuple ``(i, j, k) `` such that ``a[i:i+k] `` is
543+ equal to ``b[j:j+k] ``, where ``alo
517544 <= i <= i+k <= ahi `` and ``blo <= j <= j+k <= bhi ``. For all ``(i', j',
518545 k') `` meeting those conditions, the additional conditions ``k >= k' ``, ``i
519546 <= i' ``, and if ``i == i' ``, ``j <= j' `` are also met. In other words, of
@@ -541,18 +568,16 @@ SequenceMatcher objects
541568 >>> s.find_longest_match(0 , 5 , 0 , 9 )
542569 Match(a=1, b=0, size=4)
543570
544- If no blocks match, this returns ``(alo, blo, 0) ``.
545-
546- This method returns a :term: `named tuple ` ``Match(a, b, size) ``.
571+ If no blocks match, this returns ``Match(alo, blo, 0) ``.
547572
548573 .. versionchanged :: 3.9
549574 Added default arguments.
550575
551576
552577 .. method :: get_matching_blocks()
553578
554- Return list of triples describing non-overlapping matching subsequences.
555- Each triple is of the form ``(i, j, n) ``,
579+ Return list of :class: ` Match ` triples describing non-overlapping matching
580+ subsequences. Each triple is of the form ``(i, j, n) ``,
556581 and means that ``a[i:i+n] == b[j:j+n] ``. The
557582 triples are monotonically increasing in *i * and *j *.
558583
0 commit comments