diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2023-11-03 06:20:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-03 06:20:39 (GMT) |
commit | 0d3df272fbd131bff7f02d4d4279ad1e35081121 (patch) | |
tree | aca1956c4b4a87c72dc09e806281937fcaef1cf0 /Doc | |
parent | 3a1b09e6d070778d78d81084f88d37377d38ee9b (diff) | |
download | cpython-0d3df272fbd131bff7f02d4d4279ad1e35081121.zip cpython-0d3df272fbd131bff7f02d4d4279ad1e35081121.tar.gz cpython-0d3df272fbd131bff7f02d4d4279ad1e35081121.tar.bz2 |
gh-54434: Make difflib.rst doctests pass. (#111677)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/difflib.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index c553611..9abf195 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -171,9 +171,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. expressed in the ISO 8601 format. If not specified, the strings default to blanks. + >>> import sys + >>> from difflib import * >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n'] >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n'] - >>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', tofile='after.py')) + >>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', + ... tofile='after.py')) *** before.py --- after.py *************** @@ -294,13 +297,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. For inputs that do not have trailing newlines, set the *lineterm* argument to ``""`` so that the output will be uniformly newline free. - The context diff format normally has a header for filenames and modification + The unified diff format normally has a header for filenames and modification times. Any or all of these may be specified using strings for *fromfile*, *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally expressed in the ISO 8601 format. If not specified, the strings default to blanks. - >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n'] >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n'] >>> sys.stdout.writelines(unified_diff(s1, s2, fromfile='before.py', tofile='after.py')) |