Chris McDonough <> added the comment:

The case this that eagerly unwinding the app_iter is trying to defend against 
is (as 
you probably know) this one:

    def someapp(environ, start_response):
         start_response('200 OK', [... headers ...])
         for item in listofbytes:
             yield item

The pattern of calling start_response during the first iteration is, IMO, 
insane and 
supporting is is only a courtesty/kindness.  Unwinding every iterator from 
arbitrary downstream applications just in case someone does this, in my 
estimation at least, will cause more problems (resource exhaustion) for people 
who never do this more than not doing it will cause problems for people that 
this pattern.   You're right that someone could return a generator that streams 
exhaust RAM that way but if it's consistency we're after, I'll just rip it out 

Repoze Bugs <>
Repoze-dev mailing list

Reply via email to