diff options
author | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 +0000 |
commit | fb634813509526a134b2449f32a35d3adf08d02d (patch) | |
tree | b8d2035015ea45e3dd6b52d8f1ecabd2b264bc8f /Lib/fileinput.py | |
parent | 62d08f86da83d841e70f2181a4427df26000a322 (diff) | |
download | cpython-fb634813509526a134b2449f32a35d3adf08d02d.tar.gz |
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 f6913eb8cb..b8b98706a3 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" |