Author gvanrossum
Recipients
Date 2003-02-04.17:33:09
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6380

Yes, the special treatment of tuple, str and unicode is
problematic. :-(
I wish filter() had always returned a list for all input types.
But it's too late to change that.

However, I don't think that filter() should ever return a
*subclass* of tuple, str or unicode. Note that slicing a
subclass of these also doesn't return a subclass instance,
unless the subclass specifically overrides __getslice__.

I note that filter() of a tuple *almost* implements what I
think it should, except that if it receives an empty tuple
subclass, it returns it unchanged. The slicing and other
methods (e.g. lower()) have all been modified to make a copy
whose type is the base class; I think filter() should follow
suit.

Similar for filter() of strings and unicode.
History
Date User Action Args
2007-08-23 14:09:57adminlinkissue665835 messages
2007-08-23 14:09:57admincreate