[issue38389] Bug on sorted with count key

2019-10-06 Thread Benjamin Peterson
Benjamin Peterson added the comment: 5 and 12 both appear twice in the list, so as far as the key function is concerned, they're equal. -- nosy: +benjamin.peterson resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python trac

[issue38389] Bug on sorted with count key

2019-10-06 Thread Tamirys Pino
New submission from Tamirys Pino : >>> data=[2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12, 5] >>> data [2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12, 5] >>> sorted(data) [2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 12, 12] >>> sorted(data, key=data.count) [4, 5, 12, 12, 5, 2, 2, 2, 3, 3, 3, 3] [4, 5, 12, 12, 5, 2, 2, 2, 3, 3, 3,