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

Add "merge" method into IntervalSet class. #22

Closed
wants to merge 1 commit into from
Closed

Add "merge" method into IntervalSet class. #22

wants to merge 1 commit into from

Conversation

sunhong
Copy link

@sunhong sunhong commented May 16, 2016

This method merges all overlapping intervals.

@intiocean
Copy link
Owner

Isn't this the same as IntervalSet.union()?

@@ -261,3 +261,7 @@ def test_repr():
def test_comparison_raises_not_implemented_error_if_it_cannot_compare():
with pytest.raises(NotImplementedError):
IntervalSet() == 1

def test_merge():
Copy link
Owner

Choose a reason for hiding this comment

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

This test doesn't call the new merge function & should pass without your change

@sunhong
Copy link
Author

sunhong commented May 17, 2016

OK, I see.. Currently IntervalSet.add() merges the interval already.
But in my opinion, it is better to keep the added interval as-it-is.
Users can use merge() if they need.

@sunhong sunhong closed this May 18, 2016
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.

None yet

2 participants