Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Feb 24, 2025

Currently, one may convert from a StepRangeLen to a StepRange by using the fully parameterized constructor:

julia> r = StepRangeLen(3, 1, 4)
3:1:6

julia> StepRange{Int,Int}(r)
3:1:6

This PR adds a few other constructors that have fewer parameters specified. These parameters may be derived from the argument. After this PR, the following work:

julia> StepRange(r)
3:1:6

julia> StepRange{Int32}(r)
3:1:6

julia> StepRange{Int32}(r) |> typeof
StepRange{Int32, Int64}

@jishnub jishnub added the ranges Everything AbstractRange label Feb 24, 2025
@jishnub jishnub merged commit 5d6d757 into master Mar 5, 2025
8 checks passed
@jishnub jishnub deleted the jishnub/StepRangeLen_StepRange branch March 5, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ranges Everything AbstractRange

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants