Feature request: sorting a list slice

Harold Fellermann dadapapa at googlemail.com
Fri May 19 11:16:25 EDT 2006


Fredrik Lundh wrote:
> George Sakkis wrote:
>
> > It would be useful if list.sort() accepted two more optional
> > parameters

+1

> useful for what?  what's the use case ?

Actually, I was in need of such a construct only few weeks ago. The
task was to organize playlists
of an mp3 player. I wanted to sort future entries but not past ones
(according to an index in the
list that seperates past from future). I can imagine many more
situations in which sorting part of
a list is usefull.

While I agree that the improvement of the additional keywords is minor,
I think that the additional
load they impose on the sort function is also minor. In my oppinion,
this is a straight-forward
extension of what we already find in other places in the library. I
would like to see it in a future version.

- harold -




More information about the Python-list mailing list