On Mar 25, 3:06 pm, Steven D'Aprano <steve +comp.lang.pyt...@pearwood.info> wrote: > The reason Guido is considering re-introducing cmp is that somebody at > Google approached him with a use-case where a key-based sort did not > work. The use-case was that the user had masses of data, too much data > for the added overhead of Decorate-Sort-Undecorate (which is what key > does), but didn't care if it took a day or two to sort. > > So there is at least one use-case for preferring slowly sorting with a > comparison function over key-based sorting. I asked if there any others. > It seems not.
1. You asked for a specific kind of use case. Antoon gave you a use case, you told him that wasn't the kind of use case you were asking for, then you turn around and say "I guess there are no use cases" (without the mentioning qualification). 2. I posted two use cases in this thread that fit your criteria, and you followed up to that subthread so you most likely read them. Here they are again so you won't overlook them this time: "You have are given an obscure string collating function implented in a C library you don't have the source to." (Fits your criterion "can't be done with key=".) "I'm sitting at an interactive session and I have a convenient cmp function but no convenient key, and I care more about the four minutes it'd take to whip up a clever key function or an adapter class than the 0.2 seconds I'd save to on sorting time." (Fits your criterion "performs really badly when done so".) 3. You evidently also overlooked the use-case example posted on Python- dev that you followed up to. Call me crazy, but you seem to be overlooking a lot of things in your zeal to prove your point. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list