list.sort, was Re: [Python-Dev] decorate-sort-undecorate
Gustavo Niemeyer
niemeyer at conectiva.com
Fri Oct 17 14:39:16 EDT 2003
More information about the Python-Dev mailing list
Fri Oct 17 14:39:16 EDT 2003
- Previous message: list.sort, was Re: [Python-Dev] decorate-sort-undecorate
- Next message: [Python-Dev] accumulator display syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> >> If anything at all, i'd suggest a std-module which contains e.g. > >> 'sort', 'reverse' and 'extend' functions which always return > >> a new list, so that you could write: > >> > >> for i in reverse(somelist): > >> ... > > Gustavo> You can do reverse with [::-1] now. > > I don't think that is considered "stable" in the sorting sense. If I > sort in descending order vs ascending order, they are not mere > reversals of each other. I may well still want adjacent records whose > sort keys are identical to remain in the same order. > > What will the new reverse=True keyword arg do? Erm.. what are you talking about!? :-) I was just saying that his reverse(...) method is completely equivalent to [::-1] now, so it could safely be implemented as: reverse = lambda x: x[::-1] I wasn't trying to mention anything about sort nor keyword arguments (perhaps I just wasn't the real target of the message!?). -- Gustavo Niemeyer http://niemeyer.net
- Previous message: list.sort, was Re: [Python-Dev] decorate-sort-undecorate
- Next message: [Python-Dev] accumulator display syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list