Python's simplicity philosophy

Paul Rubin http
Mon Nov 17 13:21:04 EST 2003


David Eppstein <eppstein at ics.uci.edu> writes:
> You're complaining that stability makes implementing a list-alike's sort 
> trickier.  However it also can make using sort simpler.  Which do you 
> think happens more often?

I generally haven't found stability to be important.  When I've cared
about doing something other than sorting (possibly unstably) on some
obvious key, I've generally needed some kind of DSU.  Just sorting
stably wouldn't be enough.  If I'm using DSU anyway, then getting
stability is trivial if I happen to need it.

Anyway, requiring stability makes implementing list.sort trickier in
addition to making listalike.sort trickier.  That's no big deal for
CPython or (apparently) Jython, since the work is already done, but
typical sorting libraries don't necessarily provide stability.  If
stability were so important so much of the time, those libraries would
provide it.




More information about the Python-list mailing list