[issue45246] the sorted() documentation should refer to operator

2021-10-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 2e4d66d2e71d36de394e0e7a4e60ed7b6a539933 by Pablo Galindo (Łukasz Langa) in branch '3.10': [3.10] bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) (GH-28502)

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 0d41bf15702832540afc1b1c078bc4fde5baebd6 by Łukasz Langa in branch '3.10': [3.10] bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) (GH-28502) https://github.com/python/cpython/commit/0d41bf15702832540afc1b1c078bc4fde5baebd6

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Łukasz Langa
Change by Łukasz Langa : -- nosy: +lukasz.langa nosy_count: 5.0 -> 6.0 pull_requests: +26897 pull_request: https://github.com/python/cpython/pull/28502 ___ Python tracker ___

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread miss-islington
miss-islington added the comment: New changeset aea92de9900ceb8d679a9324fc72621940b9c8a0 by Miss Islington (bot) in branch '3.9': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/aea92de9900ceb8d679a9324fc72621940b9c8a0

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +26892 pull_request: https://github.com/python/cpython/pull/28497 ___ Python tracker ___

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26891 pull_request: https://github.com/python/cpython/pull/28496 ___ Python tracker

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 9a0dcc5b2e04d9c51350107734f12a1cbc0284a7 by Raymond Hettinger in branch 'main': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/9a0dcc5b2e04d9c51350107734f12a1cbc0284a7

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Thank you for looking into this. You're welcome :-) > Would it make sense to change list.sort() in the same way? I think not. This is a such a minor point and is a distractor. Most users would be better off focusing on the other text. --

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I've seen the new PR for sorted(), thank you for looking into this. Would it make sense to change list.sort() in the same way? -- ___ Python tracker

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +26889 pull_request: https://github.com/python/cpython/pull/28494 ___ Python tracker ___

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I would recommend the wording in the "Sorting HOW TO" from: The sort routines are guaranteed to use __lt__() when making comparisons between two objects. to: The sort routines happen to use __lt__() when making comparisons between two

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: Then what about removing it from the list.sort() documentation too? Note that maintainers of other PEPs insist that this is a known fact and base their code on that: https://github.com/python/peps/pull/2077 --

[issue45246] the sorted() documentation should refer to operator

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 on this. While it is true that __lt__ is used, we don't really want people to exploit that fact. Doing so will get them into trouble elsewhere. For example, max(seq) uses __gt__. Also, when mixing types, a return of NotImplemented will trigger a

[issue45246] the sorted() documentation should refer to operator

2021-09-20 Thread Dimitri Papadopoulos Orfanos
Change by Dimitri Papadopoulos Orfanos : -- keywords: +patch pull_requests: +26871 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28472 ___ Python tracker

[issue45246] the sorted() documentation should refer to operator

2021-09-20 Thread Dimitri Papadopoulos Orfanos
New submission from Dimitri Papadopoulos Orfanos : 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