diff options
author | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 (GMT) |
commit | a18af4e7a2091d11478754eb66ae387a85535763 (patch) | |
tree | fea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Lib/fileinput.py | |
parent | 4d2adcca52ced412d4bdf131b872729c43520d58 (diff) | |
download | cpython-a18af4e7a2091d11478754eb66ae387a85535763.zip cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.bz2 |
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ class FileInput: def __iter__(self): return self - def next(self): + def __next__(self): try: line = self._buffer[self._bufindex] except IndexError: @@ -259,7 +259,7 @@ class FileInput: 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" |