[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-18 Thread Tim Perevezentsev

New submission from Tim Perevezentsev riffm2...@gmail.com:

This code:

assert type(val) is StringType,Header values must be strings

(from here 
http://svn.python.org/view/python/tags/r271/Lib/wsgiref/handlers.py?revision=86833view=markup)

from start_response method, is not allowing to use str subclasses objects as 
header value.

Usecase:

I made class URL which subclasses str and has additional methods to manipulate 
query string. It is very handy. But when I need to set header
Location with URL object as value I get assertion error.

Can't we do this instead:

assert isinstance(val, str),Header values must be strings

--
components: Library (Lib)
messages: 126471
nosy: riffm
priority: normal
severity: normal
status: open
title: wsgiref.handlers.BaseHandler and subclasses of str
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7

___
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



[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-18 Thread Tim Perevezentsev

Tim Perevezentsev riffm2...@gmail.com added the comment:

str - immutable. So every str subclass object is normal string. I don't see any 
design violation here.

--

___
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