Closed alanjds closed 6 years ago
Comment by trotterdylan Friday Jan 20, 2017 at 16:17 GMT
That all sounds good. Let me know when I should review again.
While #102 is merged, it is not proper implementation, even without implementation of key or cmp:
$ python -c 'print sorted([1,1.0,2,2.0], reverse=True)'
[2, 2.0, 1, 1.0]
$ grumpy-runtime-src/build/bin/grumprun -c 'print sorted([1,1.0,2,2.0], reverse=True)'
[2.0, 2, 1.0, 1]
It will certainly affect types which implements comparison methods.
:/ It may be about stability too. The sort code should be checked.
Closing in favor of #120
google/grumpy#162 opened on Jan 18, 2017 by @MirkoDziadzka
Add the 'reverse' option to 'sorted()'
I'm not sure if this violates the 'stable sort definition in Python. On the other hand, this is probably only relevant when key or cmp gets implemented.