Sorting a list with entries of unequal types

Terry Reedy tjreedy at udel.edu
Fri Jan 29 07:18:22 CET 2010


On 1/28/2010 8:24 PM, Steven D'Aprano wrote:

>>> Um, what ordering do you want?
>>
>> The same ordering I'd get in Python 2; that is, determined by the types
>> of the elements.
>
> The ordering has not been consistent across minor versions of Python 2:

And complex numbers, and probably some other things, cannot be sorted 
even in Python2. Universal sorting is a broken idea, so Python3 leaves 
it to you to say what *you* mean.





More information about the Python-list mailing list