[issue43887] it seems that sorted built-in always return floats before int if they appear to be equal

2021-04-19 Thread John Mish
John Mish added the comment: Thanks, I should go deeper with it before filing. Wish You have great day Steven. -- ___ Python tracker ___

[issue43887] it seems that sorted built-in always return floats before int if they appear to be equal

2021-04-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi John, you said: > it seems that sorted built-in always return floats before int if they appear > to be equal But that's not correct: >>> sorted([5.0, 5]) [5.0, 5] >>> sorted([5, 5.0]) [5, 5.0] Python's sort is *stable*, which means that the order of

[issue43887] it seems that sorted built-in always return floats before int if they appear to be equal

2021-04-19 Thread John Mish
New submission from John Mish : A1 >>> sorted([12.001, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1, 4, 12, 12.002] A2 >>> sorted([12.0001, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1, 4, 12.0, 12] B1 >>> sorted([11.999, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1,