On Jan 26, 10:12 pm, Steven D'Aprano <ste...@remove.this.cybersource.com.au> wrote: > > I did too, when I first heard cmp was to be dumped. But I changed my mind > and now agree with the decision to drop cmp. Custom sorts are nearly > always much better written with key rather than cmp: key adds an O(N) > overheard to the sorting, while cmp makes sorting O(N**2). In other > words, key is *much* faster, and generally easier to write as well. >
Imagine what sort() could do if all the keys were platform-native types. In other words, if you could bypass the Python compare because all the keys were native int, char, char*, or float. You can't do that with cmp either. -- http://mail.python.org/mailman/listinfo/python-list