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

Skip to content

Implement range object #87

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 4 commits into from
Sep 22, 2019
Merged

Implement range object #87

merged 4 commits into from
Sep 22, 2019

Conversation

HyeockJinKim
Copy link
Contributor

Implement __repr__, __str__, __eq__, __ne__ of range

Fixes #86

py/range.go Outdated
}

func (r *Range) repr() (Object, error) {
var out bytes.Buffer
Copy link
Member

Choose a reason for hiding this comment

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

consider using strings.Builder instead? (needs Go >= 1.10, though)

Copy link
Collaborator

Choose a reason for hiding this comment

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

strings.Builder is more recommended way :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified the code. Would you please review it again?

@codecov-io
Copy link

codecov-io commented Sep 20, 2019

Codecov Report

Merging #87 into master will increase coverage by 0.05%.
The diff coverage is 74.07%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #87      +/-   ##
=========================================
+ Coverage   68.84%   68.9%   +0.05%     
=========================================
  Files          59      60       +1     
  Lines       10545   10599      +54     
=========================================
+ Hits         7260    7303      +43     
- Misses       2775    2780       +5     
- Partials      510     516       +6
Impacted Files Coverage Δ
py/range_repr110.go 70% <70%> (ø)
py/range.go 80.86% <76.47%> (+0.62%) ⬆️
py/internal.go 41.34% <0%> (+0.48%) ⬆️

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 261242c...d886727. Read the comment docs.

__repr__ print start, stop of range
if step is not one, step is also printed

Fixes go-python#86
__eq__ compare length, start, step of range
py/range.go Outdated
}

func (r *Range) repr() (Object, error) {
var b strings.Builder
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HyeockJinKim HyeockJinKim force-pushed the issue86 branch 2 times, most recently from 2a572a1 to f222b3d Compare September 20, 2019 18:26
strings.Builder is supported since v1.10,
so split files for older versions
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.

LGTM
@sbinet Can you please take a look?

@corona10 corona10 merged commit 37cc47f into go-python:master Sep 22, 2019
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.

Implement range object
4 participants