Python's simplicity philosophy

Terry Reedy tjreedy at udel.edu
Sun Nov 16 18:58:17 EST 2003


"Paul Rubin" <http://phr.cx@NOSPAM.invalid> wrote in message
news:7xoevcf1u2.fsf at ruckus.brouhaha.com...
> "Andrew Dalke" <adalke at mindspring.com> writes:
> > list.sort also became guaranteed to be stable (this include
'reverse').
>
> I don't see the reason for that.  It seems like a needless
restriction
> on implementers.

Which is why Guido long resisted making such a guarantee, in spite of
many requests.  (The previous list.sort was not stable.)  However,
timsort is stable, tested for about a year, and so fast for lists both
random and with various types of order, and so close to optimal in
terms of number of comparisons, that Guido was willing to 'annoint' it
as list.sort for the indefinite future.  If there were a generally
useful non-stable sort discovered proposed in the future, is could be
added under a different name.

Terry J. Reedy






More information about the Python-list mailing list