FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `sorted` and `list.sort` · Pull Request #81 · go-python/gpython · GitHub

Add sorted and list.sort - #81

Merged
corona10 merged 10 commits into
masterfrom
unknown repository
Sep 29, 2019
Merged

Add sorted and list.sort#81
corona10 merged 10 commits into
masterfrom
unknown repository

Conversation

ghost commented Sep 15, 2019

Copy link
Copy Markdown

No description provided.

corona10 requested a review from ncw September 15, 2019 17:16

codecov-io commented Sep 15, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

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

@@            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.

corona10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@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 commented Sep 28, 2019

Copy link
Copy Markdown
Author

@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.

Copy link
Copy Markdown
Collaborator

@Tim-St Thanks for the information!

Copy link
Copy Markdown
Collaborator

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

ghost commented Sep 28, 2019

Copy link
Copy Markdown
Author

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.

ncw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 commented Sep 28, 2019

Copy link
Copy Markdown
Author

@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 commented Sep 28, 2019

Copy link
Copy Markdown
Collaborator

@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 commented Sep 29, 2019

Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown
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 merged commit af17d7d into go-python:master Sep 29, 2019

Copy link
Copy Markdown
Collaborator

@Tim-St
Thanks for your contribution!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL