[Python-Dev] decorate-sort-undecorate
Geoffrey Talvola
gtalvola at nameconnector.com
Wed Oct 15 12:03:03 EDT 2003
More information about the Python-Dev mailing list
Wed Oct 15 12:03:03 EDT 2003
- Previous message: [Python-Dev] decorate-sort-undecorate
- Next message: [Python-Dev] decorate-sort-undecorate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum wrote: >> What about the situation where you want the list sorted in reverse >> order? If you simply sort and then reverse the list you've broken >> the stability. > > ... > How important do you think this is? We could punt on the issue, > implement reverse by reverting the list afterwards. (I could define > stability differently and be totally happy with getting everything in > reverse order rather than only the specified key. :-) If you make that the documented behavior, then if someone really needs the items sorted in reverse order, but stable with respect to the original list, then this will work: mylist.reverse() mylist.sort(key=keyfunc, reverse=True) - Geoff
- Previous message: [Python-Dev] decorate-sort-undecorate
- Next message: [Python-Dev] decorate-sort-undecorate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list