15.12.19 12:27, Steven D'Aprano пише:
Since list.sort guarantees that it will only use the `<` less than operator, should we make the same guarantee for sorted, min and/or max?
Perhaps. And also for heapq and maybe some other functions. Do you mind to create a PR?
It is common to make generic algorithms only depending on '<' and '==' (all standard C++ algorithms do this). But in any case it is better to implement all relation operators if you implement one. I do not know a case when you implement only '<'.
_______________________________________________ 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/HQHJZX5P6PI7HKEPMSSNKT3XSMIYSEV4/ Code of Conduct: http://python.org/psf/codeofconduct/