Skip to content

Commit fcdd7ab

Browse files
committed
Update docs and ACKs
1 parent fdc0fa0 commit fcdd7ab

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Doc/library/difflib.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,7 @@ Nicolas M. Thiéry
18891889
James Thomas
18901890
Reuben Thomas
18911891
Robin Thomas
1892+
Douglas Thor
18921893
Brian Thorne
18931894
Christopher Thorne
18941895
Stephen Thorne

0 commit comments

Comments
 (0)