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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4