Change filterstring() and filterunicode(): If the
object is not a real str or unicode but an instance
of a subclass, construct the output via looping
over __getitem__. This guarantees that the result
is the same for function==None and function==lambda x:x

This doesn't happen for tuples, because filtertuple()
uses PyTuple_GetItem().

(This was discussed on SF bug #665835).
2 files changed