diff options
| author | Chris McDonough <chrism@plope.com> | 2011-11-21 10:53:04 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-11-21 10:53:04 -0500 |
| commit | f7ed3f037bef2f55a89f96052c7979599a120f8b (patch) | |
| tree | 638d4a0bb384736944a29d90590fc8a2c9a01f16 /docs/file-example.txt | |
| parent | 2217de6eba0ba4ca4e72c99126b1988d2127fb27 (diff) | |
| download | webob-f7ed3f037bef2f55a89f96052c7979599a120f8b.tar.gz | |
add __next__ for py3 compat; closes #10
Diffstat (limited to 'docs/file-example.txt')
| -rw-r--r-- | docs/file-example.txt | 2 |
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: |
