-
-
Notifications
You must be signed in to change notification settings - Fork 115
range(start, stop; length, step) #633
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
Changes from 5 commits
966cdf0
f63c02c
16b7b64
021cfe6
4071b02
025c138
fbc52c3
5f7fd09
e5f549b
8d8906c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1839,6 +1839,11 @@ if VERSION < v"0.7.0-beta2.143" | |
| end | ||
| end | ||
|
|
||
| if v"0.7" ≤ VERSION | ||
| # https://github.com/JuliaLang/julia/pull/28708 | ||
| Base.range(start, stop; kwargs...) = range(start; stop=stop, kwargs...) | ||
|
||
| end | ||
|
|
||
| include("deprecated.jl") | ||
|
|
||
| end # module Compat | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1518,4 +1518,10 @@ end | |
| 3 4 3 4 3 4] | ||
| @test repeat([1, 2], 1, 2, 3) == [x for x in 1:2, y in 1:2, z in 1:3] | ||
|
|
||
| # [1.0, 1.1) | ||
| if v"0.7" ≤ VERSION && isempty(methods(range, Tuple{Any,Any})) | ||
|
||
| @test range(0, 5, length = 6) == 0.0:1.0:5.0 | ||
| @test range(0, 10, step = 2) == 0:2:10 | ||
| end | ||
martinholters marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| nothing | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this should be guarded with
&& isempty(methods(range, Tuple{Any,Any})), while the tests should not. However, on 0.7, that does not work, because of the deprecated, oldrange(a, len)methods. That also makes me wonder whether we actually should be adding this method on 0.7. I'd say yes, but might be worth discussing.