New submission from Dimitri Papadopoulos Orfanos <dimitri.papadopou...@cea.fr>:

The documentation of sorted() lacks any reference to the comparison mechanism 
between items.

Compare with the documentation of list.sort(), which starts with:
    using only < comparisons between items

This is mentioned in the "Sorting HOW TO", under "Odd and Ends":
    The sort routines are guaranteed to use __lt__() when making comparisons 
between two objects.

However, the "Sorting HOW TO" is "a brief sorting tutorial", not the reference 
documentation. This property needs to be documented in the reference 
documentation of sorted().

----------
assignee: docs@python
components: Documentation
messages: 402209
nosy: DimitriPapadopoulosOrfanos, docs@python
priority: normal
severity: normal
status: open
title: the sorted() documentation should refer to operator <
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to