Sorting list (maybe stupid)
Delaney, Timothy
tdelaney at avaya.com
Wed Jun 12 00:51:07 EDT 2002
> From: Tim Peters [mailto:tim.one at comcast.net]
>
> [Delaney, Timothy]
> > ...
> > Personally, I think the implementation should be documented to
> > use a stable sort - presumably mergesort (stable, minimal number of
> > comparisons which is very important in Python).
>
> Write a mergesort as fast and memory-efficient as the sort
> we've got and we'll consider it. I wasn't able to ...
> you'll find that mergesort doesn't have enough of an
> advantage there to make up for the speed it loses due to greater data
> movement.
I'm not willing in the slightest to dispute this ...
My preference for a stable sort as default is that it is the "least
surprising" result. But I don't see it as a wart that the implementation is
not stable.
Tim Delaney
More information about the Python-list
mailing list