Open alanjds opened 6 years ago
As pointed on https://github.com/grumpyhome/grumpy/issues/82#issuecomment-433899574, the sorting of lists are not respecting stability or comparison of types:
$ python -c 'print sorted([1,1.0,2,2.0], reverse=True)' [2, 2.0, 1, 1.0] $ grumpy -c 'print sorted([1,1.0,2,2.0], reverse=True)' [2.0, 2, 1.0, 1]
The implementation should be checked.
Problem is in current reverse option implementation. It should not be implemented as reversed(sorted(l)), but as negation of comparison function.
reverse
reversed(sorted(l))
As pointed on https://github.com/grumpyhome/grumpy/issues/82#issuecomment-433899574, the sorting of lists are not respecting stability or comparison of types:
The implementation should be checked.