@@ -278,7 +278,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
278278 emu
279279
280280
281- .. function :: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
281+ .. function :: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n', color=False )
282282
283283 Compare *a * and *b * (lists of strings); return a delta (a :term: `generator `
284284 generating the delta lines) in unified diff format.
@@ -297,6 +297,9 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
297297 For inputs that do not have trailing newlines, set the *lineterm * argument to
298298 ``"" `` so that the output will be uniformly newline free.
299299
300+ Set ``color `` to ``True `` to inject ANSI color codes and make the output look
301+ like what ``git diff --color `` shows.
302+
300303 The unified diff format normally has a header for filenames and modification
301304 times. Any or all of these may be specified using strings for *fromfile *,
302305 *tofile *, *fromfiledate *, and *tofiledate *. The modification times are normally
@@ -319,6 +322,10 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
319322
320323 See :ref: `difflib-interface ` for a more detailed example.
321324
325+ .. versionchanged :: 3.15
326+ Added the *color * parameter.
327+
328+
322329.. function :: diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'', fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n')
323330
324331 Compare *a * and *b * (lists of bytes objects) using *dfunc *; yield a
0 commit comments