Raymond Hettinger <python at rcn.com> writes: > The sort() function guarantees that it calls the key function exactly > once for each member of the list. That is a time-space tradeoff though, and it presupposes that it's possible to write a key function. Depending on the objects involved, it could be that it's easier to write a comparison function than a key function.