Python 3.0, rich comparisons and sorting order

Steven Bethard steven.bethard at gmail.com
Tue Sep 21 16:43:44 EDT 2004


Andrew Dalke <adalke <at> mindspring.com> writes:
> > Yeah, by restricting comparisons, we'd be basically saying that sort
> > is only defined for lists that take the form list<some_type>.
> 
> or where a compare function can be passed to .sort(), or
> where (in 2.4) a keys function can be passed to get the
> objects used for the comparison.  Why is this a problem?

It's not, for me at least -- I'm all for restricting sort in this way.  I'm 
just trying to understand what problems other people are trying to solve that 
they think they'd need other behavior from sort, and in what ways they can 
work around the proposed limitations.

Steve





More information about the Python-list mailing list