summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-04-18 21:00:50 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-04-18 21:00:50 (GMT)
commit386b2b18f56a44499cec67312a55fd343d6069c1 (patch)
treea1708e789ca6219e283a007a0327556ffc6dc34e /Doc/library
parentdee46b370e9856e6bbeb624513cd2fb2fa0dbdf2 (diff)
parentbddecc386123409c6b16cf931c1b175ded07bfcd (diff)
downloadcpython-386b2b18f56a44499cec67312a55fd343d6069c1.zip
cpython-386b2b18f56a44499cec67312a55fd343d6069c1.tar.gz
cpython-386b2b18f56a44499cec67312a55fd343d6069c1.tar.bz2
Merge with 3.4. Closes #21232.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/difflib.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index c661a6b..707f179 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -230,8 +230,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
? ^
@@ -254,8 +254,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
@@ -660,7 +660,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]
@@ -669,7 +669,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: