summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-10-27 03:09:10 (GMT)
committerGitHub <noreply@github.com>2018-10-27 03:09:10 (GMT)
commite389de8e3e897fa5ba4f71b0f711355fb7158049 (patch)
tree6cb706c255a04fc6916c9f9a09eef620d9928f32 /Doc
parent6f97a50c86737458c6bed9970c8dc31a465eff22 (diff)
downloadcpython-e389de8e3e897fa5ba4f71b0f711355fb7158049.zip
cpython-e389de8e3e897fa5ba4f71b0f711355fb7158049.tar.gz
cpython-e389de8e3e897fa5ba4f71b0f711355fb7158049.tar.bz2
bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)
Specify that blocks are non-overlapping. Change '!=' to '<'. (cherry picked from commit d9bff4e81b8ca36fe6c4e90c0b9cf02bc020e713) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/difflib.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index 01a3bfc..7b6cce4 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -431,14 +431,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!