Home

On Thu, 09 Aug, Graham Dumpleton wrote:

> result = application(environ, start_response)
> try:
> for data in result:
> if data: # don't send headers until body appears
> write(data)
> if not headers_sent:
> write('') # send headers now if body was empty
> finally:
> if hasattr(result,'close'):
> result.close()

Hm, not what I hoped for ...

Isn't it possible to add some __del__ method to the generator object
via some decorator or somehow else in a way that works even with Python
2.4 and can then be nicely written without cluttering up the logic
between consumer and producer?

--
Stefan Bellon

previous
next

Re: Can you please give me some advice?
Global package variable, is it possible?
urllib2.urlopen(url) pulling something other than HTML
Re: conversion between string and numerical value
Re: migrating to packages
Fundacja Avalon
Rodzic Po Ludzku
Niechciane i Zapomniane
Krwinka
Mam Marzenie