[issue5800] make wsgiref.headers.Headers accept empty constructor

Tarek Ziadé <report@bugs.python.org> at psf.upfronthosting.co.za Tarek Ziadé <report@bugs.python.org> at psf.upfronthosting.co.za
Mon Apr 20 18:01:05 CEST 2009


New submission from Tarek Ziadé <ziade.tarek at gmail.com>:

wsgiref.headers.Headers will let you manage a collection of HTTP
response headers, but the constructor forces you to provide a list:

  >>> from wsgiref.headers import Headers
  >>> headers = Headers([])
  >>> headers.add_header('Content-Type', 'text/plain')

A logical change would be to allowed creating an empty Headers instance:

  >>> from wsgiref.headers import Headers
  >>> headers = Headers()
  >>> headers.add_header('Content-Type', 'text/plain')

----------
components: Library (Lib)
messages: 86199
nosy: pje, tarek
severity: normal
status: open
title: make wsgiref.headers.Headers accept empty constructor
type: feature request
versions: Python 2.7, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5800>
_______________________________________


More information about the Python-bugs-list mailing list