diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-03-11 21:19:48 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-03-11 21:19:48 (GMT) |
commit | eb2e02bed401e5faab7f9170350d186c59262de2 (patch) | |
tree | 439d55c83d50b4ee2e488df846bef03774cb7a6b /Doc | |
parent | 04d4229719055c9536da6d4b58033981ef86d0d2 (diff) | |
download | cpython-eb2e02bed401e5faab7f9170350d186c59262de2.zip cpython-eb2e02bed401e5faab7f9170350d186c59262de2.tar.gz cpython-eb2e02bed401e5faab7f9170350d186c59262de2.tar.bz2 |
Issue #26542: Fix markup of code example in difflib documentation
Patch by Dmitry Shachnev.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/difflib.rst | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index e7e5df6..9a41f66 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -501,16 +501,14 @@ The :class:`SequenceMatcher` class has this constructor: | | are equal). | +---------------+---------------------------------------------+ - For example: + For example:: >>> a = "qabxcd" >>> b = "abycdf" >>> s = SequenceMatcher(None, a, b) >>> for tag, i1, i2, j1, j2 in s.get_opcodes(): - print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format( - tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2])) - - + ... print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format( + ... tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2])) delete a[0:1] --> b[0:0] 'q' --> '' equal a[1:3] --> b[0:2] 'ab' --> 'ab' replace a[3:4] --> b[2:3] 'x' --> 'y' |