summaryrefslogtreecommitdiffstats
path: root/Lib/codecs.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/codecs.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/codecs.py')
-rw-r--r--Lib/codecs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index 185ad42..d340725 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -600,7 +600,7 @@ class StreamReader(Codec):
self.reset()
self.stream.seek(offset, whence)
- def next(self):
+ def __next__(self):
""" Return the next decoded line from the input stream."""
line = self.readline()
@@ -669,10 +669,10 @@ class StreamReaderWriter:
return self.reader.readlines(sizehint)
- def next(self):
+ def __next__(self):
""" Return the next decoded line from the input stream."""
- return self.reader.next()
+ return next(self.reader)
def __iter__(self):
return self
@@ -782,10 +782,10 @@ class StreamRecoder:
data, bytesencoded = self.encode(data, self.errors)
return data.splitlines(1)
- def next(self):
+ def __next__(self):
""" Return the next decoded line from the input stream."""
- data = self.reader.next()
+ data = next(self.reader)
data, bytesencoded = self.encode(data, self.errors)
return data