Steven D'Aprano wrote: > On Wed, 02 May 2007 06:10:54 +0000, Tim Roberts wrote:
>> I've tended to favor the "Schwarzian transform" (decorate-sort-undecorate) >> because of that. > > That's what the key= argument does. cmp= is slow because the comparison > function is called for EVERY comparison. The key= function is only called > once per element. Right. Using sort(key=keyfunc) is supposed to be faster than decorate-sort-undecorate. And I think it is clearer too. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list