Problem with wsgiref.headers.Headers

Phil phily05 at
Fri Jan 15 22:41:29 CET 2010

I am having an issue with wsgiref.headers.Headers.

For example, if I do this...

from wsgiref.headers import Headers
list = []
wrapper = Headers(list)
wrapper['content-type'] = "text/html"

I get an empty list printed, and then the correct result for wrapper

Am I misunderstanding the documentation?

class wsgiref.headers.Headers(headers)
Create a mapping-like object wrapping headers, which must be a list of
header name/value tuples as described in PEP 333. Any changes made to
the new Headers object will directly update the headers list it was
created with.

Thanks for any help,


More information about the Python-list mailing list