[Python-Dev] total ordering.

Edward Loper edloper at gradient.cis.upenn.edu
Thu May 11 18:06:31 CEST 2006

Guido van Rossum wrote:
> On 5/11/06, Vladimir 'Yu' Stepanov <vys at renet.ru> wrote:
>> If for Python-3000 similar it will be shown concerning types
>> str(), int(), complex() and so on, and the type of exceptions
>> will strongly vary, it will make problematic redefinition of
>> behavior of function of sorting.
> Not really. We'll just document that sort() should only be used on a
> list of objects that implement a total ordering. [...]

It might be useful in some cases to have a keyword argument to 
sort/sorted that says to ignore exceptions arising from comparing 
elements, and leaves the ordering of non-comparable values undefined.


More information about the Python-Dev mailing list