PEP 3114: rename .next() to .__next__() and add next() builtin.
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index f6913eb..b8b9870 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -240,7 +240,7 @@
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
try:
line = self._buffer[self._bufindex]
except IndexError:
@@ -259,7 +259,7 @@
if i != self._lineno:
raise RuntimeError, "accessing lines out of order"
try:
- return self.next()
+ return self.__next__()
except StopIteration:
raise IndexError, "end of input reached"