@@ -226,8 +226,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
226226
227227 :file: `Tools/scripts/ndiff.py ` is a command-line front-end to this function.
228228
229- >>> diff = ndiff(' one\n two\n three\n ' .splitlines(1 ),
230- ... ' ore\n tree\n emu\n ' .splitlines(1 ))
229+ >>> diff = ndiff(' one\n two\n three\n ' .splitlines(keepends = True ),
230+ ... ' ore\n tree\n emu\n ' .splitlines(keepends = True ))
231231 >>> print (' ' .join(diff), end = " " )
232232 - one
233233 ? ^
@@ -250,8 +250,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
250250
251251 Example:
252252
253- >>> diff = ndiff(' one\n two\n three\n ' .splitlines(1 ),
254- ... ' ore\n tree\n emu\n ' .splitlines(1 ))
253+ >>> diff = ndiff(' one\n two\n three\n ' .splitlines(keepends = True ),
254+ ... ' ore\n tree\n emu\n ' .splitlines(keepends = True ))
255255 >>> diff = list (diff) # materialize the generated delta into a list
256256 >>> print (' ' .join(restore(diff, 1 )), end = " " )
257257 one
@@ -650,7 +650,7 @@ obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects):
650650 ... 2 . Explicit is better than implicit.
651651 ... 3 . Simple is better than complex .
652652 ... 4 . Complex is better than complicated.
653- ... ''' .splitlines(1 )
653+ ... ''' .splitlines(keepends=True )
654654 >>> len (text1)
655655 4
656656 >>> text1[0 ][- 1 ]
@@ -659,7 +659,7 @@ obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects):
659659 ... 3 . Simple is better than complex .
660660 ... 4 . Complicated is better than complex .
661661 ... 5 . Flat is better than nested.
662- ... ''' .splitlines(1 )
662+ ... ''' .splitlines(keepends=True )
663663
664664Next we instantiate a Differ object:
665665
0 commit comments