diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-04-18 21:00:19 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-04-18 21:00:19 (GMT) |
commit | bddecc386123409c6b16cf931c1b175ded07bfcd (patch) | |
tree | ace7b7c4e21cae7cf9f1c11b479eddf5045415f0 /Doc/library/difflib.rst | |
parent | a37ff0fb80d59946c74af874c8dcc6d629541852 (diff) | |
download | cpython-bddecc386123409c6b16cf931c1b175ded07bfcd.zip cpython-bddecc386123409c6b16cf931c1b175ded07bfcd.tar.gz cpython-bddecc386123409c6b16cf931c1b175ded07bfcd.tar.bz2 |
Issue #21232: Replace .splitlines arg '1' with 'keepends=True'.
Diffstat (limited to 'Doc/library/difflib.rst')
-rw-r--r-- | Doc/library/difflib.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 81dc0f1..2a75d2c 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -226,8 +226,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. :file:`Tools/scripts/ndiff.py` is a command-line front-end to this function. - >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), - ... 'ore\ntree\nemu\n'.splitlines(1)) + >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True), + ... 'ore\ntree\nemu\n'.splitlines(keepends=True)) >>> print(''.join(diff), end="") - one ? ^ @@ -250,8 +250,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. Example: - >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), - ... 'ore\ntree\nemu\n'.splitlines(1)) + >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True), + ... 'ore\ntree\nemu\n'.splitlines(keepends=True)) >>> diff = list(diff) # materialize the generated delta into a list >>> print(''.join(restore(diff, 1)), end="") one @@ -650,7 +650,7 @@ obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects): ... 2. Explicit is better than implicit. ... 3. Simple is better than complex. ... 4. Complex is better than complicated. - ... '''.splitlines(1) + ... '''.splitlines(keepends=True) >>> len(text1) 4 >>> text1[0][-1] @@ -659,7 +659,7 @@ obtained from the :meth:`~io.BaseIO.readlines` method of file-like objects): ... 3. Simple is better than complex. ... 4. Complicated is better than complex. ... 5. Flat is better than nested. - ... '''.splitlines(1) + ... '''.splitlines(keepends=True) Next we instantiate a Differ object: |