[Zope3-dev] Important Heads Up: I'm making IResult private

Jim Fulton jim at zope.com
Wed Dec 28 10:34:37 EST 2005


Jeff Shell wrote:
> On 12/23/05, Jim Fulton <jim at zope.com> wrote:
> 
>>I've been working on trying to clean up the IResult/response.write mess.
>>I want to retract IResult from the public API.
>>
>>Here's what I propose to do:
>>
>>- Move IResult from zope.publisher.interfaces.http to
>>   zope.publisher.http, thus making it a private interface.
>>
>>- I'm arranging that a published method can simply return a file,
>>   rather than a string. This will be how you can efficiently
>>   return large results.
> 
> 
> By file, do you mean a Python ``file`` object?

Yes, or the result of tempfile.TemporaryFile.

> Will StringIO suffice?

What would be the point?  The whole purpose if this
is to avoid loading all of the data into memory.

> Or will a very simple interface like IReadFile
> (zope.app.filerepresentation) be enough?

There is an adapter that is registered for file
and for the result of calling tempfile.TemporaryFile.
The adapter could be registered for other types, but,
due toa bug in Twisted's WSGI support, the thing
has to be pretty darn file-like, to the point that it
has to have a fileno method.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list