Python's simplicity philosophy

Paul Rubin http
Sun Nov 16 16:19:49 EST 2003


"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.  

> A discussion of whether list.sort should return self came up and was
> *very* quickly squashed by Guido.  The idea of having a second method,
> though, that did sort and returned a copy of the sorted list is still
> being considered.

Changing the behavior of list.sort would be really bad, but I
certainly favor adding a new method (maybe list.nsort).  There should
also be list.nuniq which takes a sorted list and strips duplicate
elements.




More information about the Python-list mailing list