While we're talking about annoyances

Tim Roberts timr at probo.com
Wed May 2 02:10:54 EDT 2007


Michael Hoffman <cam.ac.uk at mh391.invalid> wrote:
>
>Hint: if you find yourself using a decorate-sort-undecorate pattern, 
>sorted(key=func) or sequence.sort(key=func) might be a better idea.

Is it?  I thought I remember reading on this very list some years ago that
the performance of sequence.sort became much, much worse when a key
function was supplied.

I've tended to favor the "Schwarzian transform" (decorate-sort-undecorate)
because of that.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list