summaryrefslogtreecommitdiffstats
path: root/Lib/wsgiref
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/wsgiref
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/wsgiref')
-rw-r--r--Lib/wsgiref/util.py2
-rw-r--r--Lib/wsgiref/validate.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py
index 450a32f..5b44eda 100644
--- a/Lib/wsgiref/util.py
+++ b/Lib/wsgiref/util.py
@@ -26,7 +26,7 @@ class FileWrapper:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
data = self.filelike.read(self.blksize)
if data:
return data
diff --git a/Lib/wsgiref/validate.py b/Lib/wsgiref/validate.py
index 43784f9..09b0d95 100644
--- a/Lib/wsgiref/validate.py
+++ b/Lib/wsgiref/validate.py
@@ -98,7 +98,7 @@ Some of the things this checks:
- That it is not a string (it should be a list of a single string; a
string will work, but perform horribly).
- - That .next() returns a string
+ - That .__next__() returns a string
- That the iterator is not iterated over until start_response has
been called (that can signal either a server or application
@@ -265,10 +265,10 @@ class IteratorWrapper:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
assert_(not self.closed,
"Iterator read after closed")
- v = self.iterator.next()
+ v = next(self.iterator)
if self.check_start_response is not None:
assert_(self.check_start_response,
"The application returns and we started iterating over its body, but start_response has not yet been called")