[Python-Dev] Re: timsort?

Gareth McCaughan gmccaughan@synaptics-uk.com
Wed, 4 Jun 2003 13:21:11 +0100


Guido wrote:

[Tim:]
> > > Note that we switched from doing two minor releases per year, to
> > > something like one minor release per two years (2.2 was released
> > > in 2001!).  timsort is less than a year old, IIRC.  Since it can
> > > raise MemoryError where the 2.2 sort could not, and may compute
> > > different results on the same inputs, it was much more a new
> > > feature than a bugfix.

[me:]
> > Remind me why raising MemoryError is better than punting
> > and sorting the list some other way?

[Guido:]
> Because the old way requires just as much code as the new way, and we
> don't want both versions of the code around?

Sure, but the old and new ways require all that code only so
that they can be very fast. Why not switch to a simpler but
slower sort (say, a simple implementation of quicksort) instead
of giving a MemoryError?

-- 
g