copysort patch, was RE: [Python-Dev] inline sort option
Phillip J. Eby
pje at telecommunity.com
Mon Oct 20 15:42:20 EDT 2003
At 12:24 PM 10/20/03 -0700, Guido van Rossum wrote:
> > [Ian cites "preferably only one obvious way to do it" to justify a sort
>That's one of the best ways I've seen this formulated.
Does this extend by analogy to other requests for short functions that are
commonly reimplemented? Not that any spring to mind at the moment; it just
seems to me that inline sorting is one of a set of perennially requested
such functions or methods, where the current standard answer is "but you
can do it yourself in only X lines!".
>If Alex's proposal to have list.sorted() as a factory function is
>acceptable to the non-English-speaking crowd, I think we can settle on
>that. (Hm, an alternative would be to add a "sort=True" keyword
>argument to list()...)
Wouldn't it need to grow key and cmpfunc, too?
More information about the Python-Dev