[New-bugs-announce] [issue38389] Bug on sorted with count key

Tamirys Pino report at bugs.python.org
Mon Oct 7 00:29:16 EDT 2019


New submission from Tamirys Pino <taamypino at gmail.com>:

>>> 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, 3] should be [4, 5, 5, 12, 12, 2, 2, 2, 3, 3, 3, 3]

----------
messages: 354063
nosy: Tamirys Pino
priority: normal
severity: normal
status: open
title: Bug on sorted with count key
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38389>
_______________________________________


More information about the New-bugs-announce mailing list