Add range(start, stop) and range(start, stop, length)#39228
Merged
mbauman merged 9 commits intoJuliaLang:masterfrom Feb 4, 2021
Merged
Add range(start, stop) and range(start, stop, length)#39228mbauman merged 9 commits intoJuliaLang:masterfrom
mbauman merged 9 commits intoJuliaLang:masterfrom
Conversation
mkitti
reviewed
Jan 13, 2021
mkitti
reviewed
Jan 13, 2021
mkitti
reviewed
Jan 13, 2021
mkitti
reviewed
Jan 13, 2021
mbauman
reviewed
Jan 13, 2021
mkitti
reviewed
Jan 15, 2021
test/ranges.jl
Outdated
Comment on lines
+17
to
+21
| @test r === range( stop=last(r), length=length(r)) | ||
| @test r === range(first(r), last(r)) | ||
| # the next ones use ==, because it changes the eltype | ||
| @test r == range(first(r), last(r), length(r)) | ||
| @test r == range(start=first(r), stop=last(r), length=length(r)) |
Contributor
There was a problem hiding this comment.
Suggested change
| @test r === range( stop=last(r), length=length(r)) | |
| @test r === range(first(r), last(r)) | |
| # the next ones use ==, because it changes the eltype | |
| @test r == range(first(r), last(r), length(r)) | |
| @test r == range(start=first(r), stop=last(r), length=length(r)) | |
| @test r === range( stop=last(r), length=length(r)) | |
| @test r === range( first(r), last(r) ) | |
| # the next ones use ==, because it changes the eltype | |
| @test r == range( first(r), last(r), length(r)) | |
| @test r == range(start=first(r), stop=last(r), length=length(r)) |
@jw3126 did a nice job of lining up similar aspects from each line. Perhaps we should maintain that style.
Contributor
|
While I am in favor of this, it is controversal: |
Contributor
Yes, but it's been discussed recently. See #38750 (comment) |
Contributor
|
I just noticed that the tests you wrote are in a testset titled "range(;kw...)" |
Contributor
Author
|
Thanks, I just removed the testset. |
Contributor
|
Merge conflict due to #39283 |
mbauman
approved these changes
Feb 4, 2021
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
* Add range(start, stop) and range(start, stop, length) Co-authored-by: Matt Bauman <mbauman@juliacomputing.com>
antoine-levitt
added a commit
to antoine-levitt/julia
that referenced
this pull request
May 9, 2021
* Add range(start, stop) and range(start, stop, length) Co-authored-by: Matt Bauman <mbauman@juliacomputing.com>
matthias314
added a commit
to matthias314/julia
that referenced
this pull request
Jun 11, 2021
* added comments and reference for zero-dimensional arrays * updated table entry for `range` to reflect JuliaLang#39228 * made spelling of "one-dimensional" etc. uniform throughout the documentation
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #38750
I implemented
range(start, stop)as that seemed simpler to document and be more consistent with the main docs. I can leave it undefined as it was before if people prefer.