-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Missing method convert{T}(Vector{T}, ::Range)
#13532
Comments
So you will be fine if you If you have follow-up questions, please post them to the mailing list. Thanks! |
We currently only have |
Indeed, the recent thread about this on julia-users made it clear that |
linspace()
or convert
?convert{T}(Vector{T}, ::Range)
Cross-ref #10064 |
Shouldn't we just have
? We shouldn't need a |
Yes, that seems right. We also probably want |
@simonster Shouldn't the second case just be: I believe AbstractArray in the second argument should take care of all ranks of arrays. The only other reason we would want the definition you suggested would be to enforce the equality of rank. Is that correct? Also, can I add this method to array.jl? |
@gdevania, @simonster was suggesting the case where you specify the dimensionality of the destination array explicitly, in which case the Also, note that Basically, we just need a PR that adds two methods: convert{T}(::Type{Array{T}}, X::AbstractArray) = copy!(Array(T, size(X)), X)
convert{T,S,N}(::Type{Array{T,N}}, X::AbstractArray{S,N}) = copy!(Array(T, size(X)), X) |
Closed by #13683 |
I'm not sure if this is a bug or I am missing something in v0.4.0:
Compare with v0.3.8:
I'm new to Julia. So, bear me if I'm wrong.
The text was updated successfully, but these errors were encountered: