Message332954
> 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. |
|
Date |
User |
Action |
Args |
2019-01-04 00:39:10 | steven.daprano | set | recipients:
+ steven.daprano, tim.peters, rhettinger, mjpieters, docs@python |
2019-01-04 00:39:08 | steven.daprano | set | messageid: <1546562348.66.0.479829328187.issue35654@roundup.psfhosted.org> |
2019-01-04 00:39:08 | steven.daprano | link | issue35654 messages |
2019-01-04 00:39:08 | steven.daprano | create | |
|