@@ -173,9 +173,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
173
173
expressed in the ISO 8601 format. If not specified, the
174
174
strings default to blanks.
175
175
176
+ >>> import sys
177
+ >>> from difflib import *
176
178
>>> s1 = [' bacon\n ' , ' eggs\n ' , ' ham\n ' , ' guido\n ' ]
177
179
>>> 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' ))
179
182
*** before.py
180
183
--- after.py
181
184
***************
@@ -298,13 +301,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
298
301
For inputs that do not have trailing newlines, set the *lineterm * argument to
299
302
``"" `` so that the output will be uniformly newline free.
300
303
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
302
305
times. Any or all of these may be specified using strings for *fromfile *,
303
306
*tofile *, *fromfiledate *, and *tofiledate *. The modification times are normally
304
307
expressed in the ISO 8601 format. If not specified, the
305
308
strings default to blanks.
306
309
307
-
308
310
>>> s1 = [' bacon\n ' , ' eggs\n ' , ' ham\n ' , ' guido\n ' ]
309
311
>>> s2 = [' python\n ' , ' eggy\n ' , ' hamster\n ' , ' guido\n ' ]
310
312
>>> sys.stdout.writelines(unified_diff(s1, s2, fromfile = ' before.py' , tofile = ' after.py' ))
0 commit comments