The list.sort method is documented to only use less than:

https://docs.python.org/3/library/stdtypes.html#list.sort

but I don't think that is correct, it seems to use greater than if it 
exists and less than doesn't. My understanding is that items need to 
define one of l.t. or g.t. to make it sortable, not the full complement 
of six rich comparison methods.

The same seems to be the case for sorted, min and max, but none of them 
have documented that fact:

https://docs.python.org/3/library/functions.html#max
https://docs.python.org/3/library/functions.html#min
https://docs.python.org/3/library/functions.html#sorted

Should we document that all four functions will use l.t. if it exists, 
otherwise g.t. if it exists, but don't need both?


-- 
Steven
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5AQMG6ADD6RGPLI3VTILB2MKXMBFTIGU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to