Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add sorted and list.sort #81

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

Merged
merged 10 commits into from Sep 29, 2019
Merged

Add sorted and list.sort #81

merged 10 commits into from Sep 29, 2019

Conversation

ghost
Copy link

@ghost ghost commented Sep 15, 2019

No description provided.

@corona10 corona10 requested a review from ncw September 15, 2019 17:16
@codecov-io
Copy link

codecov-io commented Sep 15, 2019

Codecov Report

Merging #81 into master will increase coverage by 0.7%.
The diff coverage is 67.96%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #81     +/-   ##
=========================================
+ Coverage   68.65%   69.36%   +0.7%     
=========================================
  Files          59       60      +1     
  Lines       10525    10778    +253     
=========================================
+ Hits         7226     7476    +250     
+ Misses       2790     2775     -15     
- Partials      509      527     +18
Impacted Files Coverage Δ
builtin/builtin.go 80.17% <100%> (+0.49%) ⬆️
py/list.go 46.71% <62.92%> (+11.58%) ⬆️
repl/repl.go 100% <0%> (ø) ⬆️
py/range_repr110.go 70% <0%> (ø)
py/type.go 52.36% <0%> (+0.81%) ⬆️
py/internal.go 41.78% <0%> (+0.91%) ⬆️
py/sequence.go 54.83% <0%> (+2.15%) ⬆️
py/method.go 61.32% <0%> (+2.83%) ⬆️
py/float.go 35.23% <0%> (+2.85%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb115a9...5f7a289. Read the comment docs.

Copy link
Collaborator

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tim-St Hi, Thanks for the contribution.
I know implementing sort for python interpreter(tim sort) is very hard.
Would you like to add the test about the list for your change?
The test should be run at here.
https://github.com/go-python/gpython/blob/master/py/tests/list.py
Might be coverage will be increased.

@ghost
Copy link
Author

ghost commented Sep 28, 2019

@corona10 Ok, I will add some test cases.
There is a PR at golang that implements Block Sort, which will improve the stable sort, once it's merged. Timsort isn't wanted in Go because it uses O(n) space currently.

@corona10
Copy link
Collaborator

@Tim-St Thanks for the information!

@corona10
Copy link
Collaborator

@ncw @sbinet Can you take a look at this PR?

@ghost
Copy link
Author

ghost commented Sep 28, 2019

I will add one more thing.

a = [1,3,2]
assert list.sort(a) is None
assert a == [1, 2, 3]

should work. Currently this syntax doesn't work for list.append etc too.

Copy link
Collaborator

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like excellent work :-)

If we could get the coverage of the patch up to above the threshold that would be perfect!

I didn't see anything which I thought needed changing :-)

@ghost
Copy link
Author

ghost commented Sep 28, 2019

@ncw Thanks! I'd like to change it to get a higher score, but I don't understand how "codecov" measures the results, and there are no hints on the page which parts should be changed :\

@ncw
Copy link
Collaborator

ncw commented Sep 28, 2019

@ncw Thanks! I'd like to change it to get a higher score, but I don't understand how "codecov" measures the results, and there are no hints on the page which parts should be changed :\

:-)

The output is a bit cryptic

The easiest way to improve the coverage is to use the go coverage tools locally to see the bits which haven't been covered in the code you've added. Cover those and the coveralls score will increase!

@ghost
Copy link
Author

ghost commented Sep 29, 2019

Hm, when I run this cover tool, most of the code in list.go is marked red, not only my code. I don't know how to improve this, maybe someone can show me how to get this right.

@corona10
Copy link
Collaborator

This looks like excellent work :-)
If we could get the coverage of the patch up to above the threshold that would be perfect!
I didn't see anything which I thought needed changing :-

@Tim-St cc @ncw
If there no issue with the current code without code coverage.
We can go to merge it.

@corona10 corona10 merged commit af17d7d into go-python:master Sep 29, 2019
@corona10
Copy link
Collaborator

@Tim-St
Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

4 participants