diff --git a/README.md b/README.md index 60a217e30..4ba069810 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,6 @@ Currently, the `@compat` macro supports the following syntaxes: ## Renaming -* `squeeze` is now `dropdims` ([#28303], [#26660]). - ## New macros ## Other changes diff --git a/src/Compat.jl b/src/Compat.jl index 248151f74..ca81d8c4b 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -82,25 +82,6 @@ end end end -# https://github.com/JuliaLang/julia/pull/28303 -if VERSION < v"0.7.0-beta2.143" - export dropdims - # https://github.com/JuliaLang/julia/pull/26660 - if VERSION >= v"0.7.0-DEV.4738" - dropdims( - X; - dims = throw( - UndefKeywordError("dropdims: keyword argument dims not assigned")) - ) = squeeze(X, dims = dims) - else - dropdims( - X; - dims = throw( - UndefKeywordError("dropdims: keyword argument dims not assigned")) - ) = squeeze(X, dims) - end -end - function rangedepwarn(;step=nothing, length=nothing, kwargs...) if step===nothing && length===nothing Base.depwarn("`range(start, stop)` (with neither `length` nor `step` given) is deprecated, use `range(start, stop=stop)` instead.", :range) diff --git a/test/old.jl b/test/old.jl index 3a55ef5db..c94e4083d 100644 --- a/test/old.jl +++ b/test/old.jl @@ -1264,3 +1264,11 @@ end @test floatmin(Float16) == @eval $(Core.Intrinsics.bitcast(Float16, 0x0400)) @test floatmax(Float32) == @eval $(Core.Intrinsics.bitcast(Float32, 0x7f7fffff)) @test floatmin(zero(Float64)) == floatmin(Float64) + +# 0.7.0-beta2.143 +if VERSION < v"0.7.0-beta2.143" + let a = reshape(Vector(1:4),(2,2,1,1)), b = reshape(Vector(1:4), (2,2,1)) + @test dropdims(a; dims=3) == b + @test_throws UndefKeywordError dropdims(a) + end +end diff --git a/test/runtests.jl b/test/runtests.jl index e9805b24b..c5a0c79ac 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -103,14 +103,6 @@ let @test_throws UndefKeywordError func5(x=2) end -# 0.7.0-beta2.143 -if VERSION < v"0.7.0-beta2.143" - let a = reshape(Vector(1:4),(2,2,1,1)), b = reshape(Vector(1:4), (2,2,1)) - @test dropdims(a; dims=3) == b - @test_throws UndefKeywordError dropdims(a) - end -end - # Support for positional `stop` @test Compat.range(0, 5, length = 6) == 0.0:1.0:5.0 @test Compat.range(0, 10, step = 2) == 0:2:10