This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients docs@python, mjpieters, rhettinger, steven.daprano, tim.peters
Date 2019-01-04.00:39:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546562348.66.0.479829328187.issue35654@roundup.psfhosted.org>
In-reply-to
Content
> That sort currently uses __lt__ only is, in my opinion, an implementation detail.

Its only an implementation detail until the language specification defines it as a guarantee of the language. Then it becomes part of the sorting API.

Personally, I think it is a nice feature that sorting works for objects which define only __lt__, and it sounds like Tim is happy for that to be part of the sort API.

This is documented under list.sort() but not sorted():

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

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

Rather than removing it from the HOWTO, I would rather document that fact under sorted() as well.

If you still want to argue that we should not document this as a language guarantee, for the sake of other implementations such as Jython and IronPython, you should raise it on Python-Dev. It would probably help if you had other implementation maintainers state that this was a burden on them.

For what it is worth, it seems that Jython 2.5 supports this feature too.
History
Date User Action Args
2019-01-04 00:39:10steven.dapranosetrecipients: + steven.daprano, tim.peters, rhettinger, mjpieters, docs@python
2019-01-04 00:39:08steven.dapranosetmessageid: <1546562348.66.0.479829328187.issue35654@roundup.psfhosted.org>
2019-01-04 00:39:08steven.dapranolinkissue35654 messages
2019-01-04 00:39:08steven.dapranocreate