Message13999
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. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:09:57 | admin | link | issue665835 messages |
| 2007-08-23 14:09:57 | admin | create | |
|