summaryrefslogtreecommitdiffstats
path: root/Lib/difflib.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-04-21 15:47:16 (GMT)
committerGeorg Brandl <georg@python.org>2007-04-21 15:47:16 (GMT)
commita18af4e7a2091d11478754eb66ae387a85535763 (patch)
treefea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Lib/difflib.py
parent4d2adcca52ced412d4bdf131b872729c43520d58 (diff)
downloadcpython-a18af4e7a2091d11478754eb66ae387a85535763.zip
cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz
cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.bz2
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r--Lib/difflib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 2dca749..2a057d9 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -1430,7 +1430,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
# so we can do some very readable comparisons.
while len(lines) < 4:
try:
- lines.append(diff_lines_iterator.next())
+ lines.append(next(diff_lines_iterator))
except StopIteration:
lines.append('X')
s = ''.join([line[0] for line in lines])
@@ -1517,7 +1517,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
while True:
# Collecting lines of text until we have a from/to pair
while (len(fromlines)==0 or len(tolines)==0):
- from_line, to_line, found_diff =line_iterator.next()
+ from_line, to_line, found_diff = next(line_iterator)
if from_line is not None:
fromlines.append((from_line,found_diff))
if to_line is not None:
@@ -1532,7 +1532,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
line_pair_iterator = _line_pair_iterator()
if context is None:
while True:
- yield line_pair_iterator.next()
+ yield next(line_pair_iterator)
# Handle case where user wants context differencing. We must do some
# storage of lines until we know for sure that they are to be yielded.
else:
@@ -1545,7 +1545,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
index, contextLines = 0, [None]*(context)
found_diff = False
while(found_diff is False):
- from_line, to_line, found_diff = line_pair_iterator.next()
+ from_line, to_line, found_diff = next(line_pair_iterator)
i = index % context
contextLines[i] = (from_line, to_line, found_diff)
index += 1
@@ -1565,7 +1565,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
# Now yield the context lines after the change
lines_to_write = context-1
while(lines_to_write):
- from_line, to_line, found_diff = line_pair_iterator.next()
+ from_line, to_line, found_diff = next(line_pair_iterator)
# If another change within the context, extend the context
if found_diff:
lines_to_write = context-1