summaryrefslogtreecommitdiffstats
path: root/Lib/difflib.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-09-28 14:48:40 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-09-28 14:48:40 (GMT)
commite56717c3d201db2dadacd20f654d6be7f9ed18ed (patch)
treee0df9e7bf6ab16052edaa32311ab66278bc73404 /Lib/difflib.py
parent19f6260710b3d086abcbe400194b203be11b60ab (diff)
parentd8b509b192a67f0f217ae52ed81fc91bc27a1818 (diff)
downloadcpython-e56717c3d201db2dadacd20f654d6be7f9ed18ed.zip
cpython-e56717c3d201db2dadacd20f654d6be7f9ed18ed.tar.gz
cpython-e56717c3d201db2dadacd20f654d6be7f9ed18ed.tar.bz2
merge heads
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r--Lib/difflib.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index e6cc6ee..d34bbca 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -800,7 +800,7 @@ class Differ:
... 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]
@@ -809,7 +809,7 @@ class Differ:
... 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:
@@ -896,8 +896,8 @@ class Differ:
Example:
- >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(1),
- ... 'ore\ntree\nemu\n'.splitlines(1))),
+ >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True),
+ ... 'ore\ntree\nemu\n'.splitlines(True))),
... end="")
- one
? ^
@@ -1269,8 +1269,8 @@ def context_diff(a, b, fromfile='', tofile='',
Example:
- >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1),
- ... 'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current')),
+ >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
+ ... 'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
... end="")
*** Original
--- Current
@@ -1339,8 +1339,8 @@ def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
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))
>>> print(''.join(diff), end="")
- one
? ^
@@ -2034,8 +2034,8 @@ def restore(delta, which):
Examples:
- >>> 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)
>>> print(''.join(restore(diff, 1)), end="")
one