@@ -230,8 +230,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
230230
231231 :file: `Tools/scripts/ndiff.py ` is a command-line front-end to this function.
232232
233- >>> diff = ndiff(' one\n two\n three\n ' .splitlines(1 ),
234- ... ' ore\n tree\n emu\n ' .splitlines(1 ))
233+ >>> diff = ndiff(' one\n two\n three\n ' .splitlines(keepends = True ),
234+ ... ' ore\n tree\n emu\n ' .splitlines(keepends = True ))
235235 >>> print (' ' .join(diff), end = " " )
236236 - one
237237 ? ^
@@ -254,8 +254,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
254254
255255 Example:
256256
257- >>> diff = ndiff(' one\n two\n three\n ' .splitlines(1 ),
258- ... ' ore\n tree\n emu\n ' .splitlines(1 ))
257+ >>> diff = ndiff(' one\n two\n three\n ' .splitlines(keepends = True ),
258+ ... ' ore\n tree\n emu\n ' .splitlines(keepends = True ))
259259 >>> diff = list (diff) # materialize the generated delta into a list
260260 >>> print (' ' .join(restore(diff, 1 )), end = " " )
261261 one
@@ -660,7 +660,7 @@ obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects):
660660 ... 2 . Explicit is better than implicit.
661661 ... 3 . Simple is better than complex .
662662 ... 4 . Complex is better than complicated.
663- ... ''' .splitlines(1 )
663+ ... ''' .splitlines(keepends=True )
664664 >>> len (text1)
665665 4
666666 >>> text1[0 ][- 1 ]
@@ -669,7 +669,7 @@ obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects):
669669 ... 3 . Simple is better than complex .
670670 ... 4 . Complicated is better than complex .
671671 ... 5 . Flat is better than nested.
672- ... ''' .splitlines(1 )
672+ ... ''' .splitlines(keepends=True )
673673
674674Next we instantiate a Differ object:
675675
0 commit comments