Phillip J. Eby <p...@telecommunity.com> added the comment:

Doesn't matter how unpythonic it is: the spec calls for exact types and has 
done so for six years already, so it's a bit late to do anything about it.  
(And any version of Python that allowed string subclasses was in violation of 
the spec and therefore buggy.)

In principle, this class could allow non-str objects if and ONLY if they were 
converted to actual str objects upon receipt -- but they would have to be the 
*exact* type after this conversion.

If somebody wants to implement that, I have no objection.  But it MUST reject 
non-basestring input values and values that don't convert to an exact type str. 
 (IOW, "type(str(x)) is str" must hold.)

To put it another way, the WSGI protocol requires output headers to be of type 
'list' where all elements are type 'tuple' and containing two 'str' entries.  
The Headers class cannot fulfill this contract if it allows non-conforming 
input.  So non-conforming input must either be rejected or made to conform.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10935>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to