diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2016-08-10 06:01:05 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2016-08-10 06:01:05 (GMT) |
commit | 11328fc48056bc47e920c60fe2f6bb257ae1480a (patch) | |
tree | d707c74fa6850466ede8e24ec8d902ffb398795f /Doc/library/difflib.rst | |
parent | 7a573706374cac074f00d8e3f14d1b2db9fc89c6 (diff) | |
parent | 9f8b3a0b9258860f3adbdef478a1caf60940df94 (diff) | |
download | cpython-11328fc48056bc47e920c60fe2f6bb257ae1480a.zip cpython-11328fc48056bc47e920c60fe2f6bb257ae1480a.tar.gz cpython-11328fc48056bc47e920c60fe2f6bb257ae1480a.tar.bz2 |
Closes #27210: Merge with 3.5
Diffstat (limited to 'Doc/library/difflib.rst')
-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 59a6478..6743bdc 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -170,8 +170,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n'] >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n'] - >>> for line in context_diff(s1, s2, fromfile='before.py', tofile='after.py'): - ... sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE + >>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', tofile='after.py')) *** before.py --- after.py *************** @@ -209,7 +208,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. >>> import keyword >>> get_close_matches('wheel', keyword.kwlist) ['while'] - >>> get_close_matches('apple', keyword.kwlist) + >>> get_close_matches('pineapple', keyword.kwlist) [] >>> get_close_matches('accept', keyword.kwlist) ['except'] @@ -303,8 +302,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n'] >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n'] - >>> for line in unified_diff(s1, s2, fromfile='before.py', tofile='after.py'): - ... sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE + >>> sys.stdout.writelines(unified_diff(s1, s2, fromfile='before.py', tofile='after.py')) --- before.py +++ after.py @@ -1,4 +1,4 @@ |