Add compatibility for view#238
Conversation
src/Compat.jl
Outdated
| end | ||
|
|
||
| if isdefined(Base, :view) | ||
| nothing |
There was a problem hiding this comment.
You should reverse the branch condition and delete this....
test/runtests.jl
Outdated
|
|
||
| # Add test for Base.view | ||
| let a = rand(10,10) | ||
| @test view(a, 1, :) == slice(a, 1, :) |
There was a problem hiding this comment.
Won't this trigger a depwarn on 0.5? Maybe construct a view and compare it with getindex and check that mutating the view aliases the original one.
test/runtests.jl
Outdated
|
|
||
| # Add test for Base.view | ||
| let a = rand(10,10) | ||
| @test Array(view(a, :, 1)) == a[:,1] |
There was a problem hiding this comment.
The Array shouldn't be necessary.
There was a problem hiding this comment.
You are right, it seems to work without that.
README.md
Outdated
|
|
||
| * `write(::IO, ::Ptr, len)` is now `unsafe_write` [#14766](https://github.com/JuliaLang/julia/pull/14766). | ||
|
|
||
| * `slice` is now `view`: do `import Compat.view` and then use `view` normally without the `@compat` macro. |
There was a problem hiding this comment.
reference the julia PR - I think it was by @simonbyrne if that helps find it faster
|
LGTM (need squash or squash on merge) |
|
@tkelman or someone, can we merge, and tag a new release please? |
|
@TotalVerb can you tag a new release please? There are packages that are dependent on this. Thanks! |
|
I will once CI passes. Thanks for the contribution! |
|
@tkelman I can't figure out how to tag a release. Could you handle this one? |
Test added, README modified. Fixes #235 .