summaryrefslogtreecommitdiff
path: root/docs/file-example.txt
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-11-21 10:53:04 -0500
committerChris McDonough <chrism@plope.com>2011-11-21 10:53:04 -0500
commitf7ed3f037bef2f55a89f96052c7979599a120f8b (patch)
tree638d4a0bb384736944a29d90590fc8a2c9a01f16 /docs/file-example.txt
parent2217de6eba0ba4ca4e72c99126b1988d2127fb27 (diff)
downloadwebob-f7ed3f037bef2f55a89f96052c7979599a120f8b.tar.gz
add __next__ for py3 compat; closes #10
Diffstat (limited to 'docs/file-example.txt')
-rw-r--r--docs/file-example.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/file-example.txt b/docs/file-example.txt
index 16d4d19..29f30fd 100644
--- a/docs/file-example.txt
+++ b/docs/file-example.txt
@@ -80,6 +80,7 @@ everything into memory, and that's bad. We'll create an iterator instead:
... if not chunk:
... raise StopIteration
... return chunk
+ ... __next__ = next # py3 compat
>>> def make_response(filename):
... res = Response(content_type=get_mimetype(filename))
... res.app_iter = FileIterable(filename)
@@ -185,6 +186,7 @@ looks for:
... # Chop off the extra:
... chunk = chunk[:self.length]
... return chunk
+ ... __next__ = next # py3 compat
Now we'll test it out: