Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check stability of sorted() code #120

Open
alanjds opened this issue Oct 29, 2018 · 1 comment
Open

Check stability of sorted() code #120

alanjds opened this issue Oct 29, 2018 · 1 comment

Comments

@alanjds
Copy link

alanjds commented Oct 29, 2018

As pointed on #82 (comment), 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.

@funny-falcon
Copy link

Problem is in current reverse option implementation. It should not be implemented as reversed(sorted(l)), but as negation of comparison function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants