Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions Doc/library/difflib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,15 @@ The :class:`SequenceMatcher` class has this constructor:

.. method:: get_matching_blocks()

Return list of triples describing matching subsequences. Each triple is of
the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j+n]``. The
Return list of triples describing non-overlapping matching subsequences.
Each triple is of the form ``(i, j, n)``,
and means that ``a[i:i+n] == b[j:j+n]``. The
triples are monotonically increasing in *i* and *j*.

The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It
is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')``
are adjacent triples in the list, and the second is not the last triple in
the list, then ``i+n != i'`` or ``j+n != j'``; in other words, adjacent
the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent
triples always describe non-adjacent equal blocks.

.. XXX Explain why a dummy is used!
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improve difflib.SequenceManager.get_matching_blocks doc by adding 'non-
overlapping' and changing '!=' to '<'.