@@ -173,9 +173,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
173173 expressed in the ISO 8601 format. If not specified, the
174174 strings default to blanks.
175175
176+ >>> import sys
177+ >>> from difflib import *
176178 >>> s1 = [' bacon\n ' , ' eggs\n ' , ' ham\n ' , ' guido\n ' ]
177179 >>> s2 = [' python\n ' , ' eggy\n ' , ' hamster\n ' , ' guido\n ' ]
178- >>> sys.stdout.writelines(context_diff(s1, s2, fromfile = ' before.py' , tofile = ' after.py' ))
180+ >>> sys.stdout.writelines(context_diff(s1, s2, fromfile = ' before.py' ,
181+ ... tofile= ' after.py' ))
179182 *** before.py
180183 --- after.py
181184 ***************
@@ -298,13 +301,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
298301 For inputs that do not have trailing newlines, set the *lineterm * argument to
299302 ``"" `` so that the output will be uniformly newline free.
300303
301- The context diff format normally has a header for filenames and modification
304+ The unified diff format normally has a header for filenames and modification
302305 times. Any or all of these may be specified using strings for *fromfile *,
303306 *tofile *, *fromfiledate *, and *tofiledate *. The modification times are normally
304307 expressed in the ISO 8601 format. If not specified, the
305308 strings default to blanks.
306309
307-
308310 >>> s1 = [' bacon\n ' , ' eggs\n ' , ' ham\n ' , ' guido\n ' ]
309311 >>> s2 = [' python\n ' , ' eggy\n ' , ' hamster\n ' , ' guido\n ' ]
310312 >>> sys.stdout.writelines(unified_diff(s1, s2, fromfile = ' before.py' , tofile = ' after.py' ))
0 commit comments