Add `sorted` and `list.sort` · Pull Request #81 · go-python/gpython
Repository navigation
Add sorted and list.sort - #81
Merged
corona10 merged 10 commits into master from unknown repository Sep 29, 2019
Merged
Add sorted and list.sort #81
corona10 merged 10 commits into
master from
unknown repository
Conversation
ghost commented Sep 15, 2019
Copy link Copy Markdown
No description provided.
Tim-St added 4 commits September 10, 2019 19:59
Add sorted and list.sort
ffb374f
Mostly finished, needs some argument parsing changes.
Unpacking of args works now for sorted and list.sort
7cc1d0b
add tests
d31767d
new try
cf32df7
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
@@ 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
Continue to review full report at Codecov .
|
View reviewed changes
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 .
@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. |
corona10 commented Sep 28, 2019
Copy link Copy Markdown
Collaborator
|
@Tim-St Thanks for the information! |
Add tests for list.sort
f411862
Update list.py
a432c54
corona10 commented Sep 28, 2019
Copy link Copy Markdown
Collaborator
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 |
support list.sort([], **kwargs)
6b84462
Update list.go
af6732d
better NoneType comparison
c8d35a9
ncw
reviewed
Sep 28, 2019
View reviewed changes
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 .
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
:-) 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! |
put tests for sorted in builtin.py
5f7a289
ghost commented Sep 29, 2019
Copy link Copy Markdown
Author
|
Hm, when I run this |
corona10 commented Sep 29, 2019
Copy link Copy Markdown
Collaborator
@Tim-St cc @ncw |
af17d7d
into
go-python : master
Sep 29, 2019
corona10 commented Sep 29, 2019
Copy link Copy Markdown
Collaborator
|
@Tim-St |
Add sorted and list.sort (go-python#81)
1ec6dfb
* Add `sorted` and `list.sort` Mostly finished, needs some argument parsing changes. * Unpacking of args works now for `sorted` and `list.sort` * add tests * new try * Add tests for `list.sort` * Update list.py * support `list.sort([], **kwargs)` * Update list.go * better NoneType comparison * put tests for `sorted` in `builtin.py`Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment