diff --git a/README.md b/README.md index 68579c8c7..33abde204 100644 --- a/README.md +++ b/README.md @@ -223,10 +223,6 @@ Currently, the `@compat` macro supports the following syntaxes: * `select`* functions (`select`, `select!`, `selectperm`, `selectperm!`) are renamed to `partialsort`* (`partialsort`, `partialsort!`, `partialsortperm`, `partialsortperm!`) ([#23051]) -* Math constants (`π`, `pi`, `e`, `γ`, `eulergamma`, `catalan`, `φ`, `golden`) are moved to the - `MathConstants` module (available as `Compat.MathConstants`). - The name exported from `Base` for `e` is changed to `ℯ`. ([#23427]) - * `IntSet` is now `BitSet` ([#24282]) * `strwidth` and `charwidth` are now merged into `textwidth` ([#23667]). diff --git a/src/Compat.jl b/src/Compat.jl index d0b8b67cb..47a1fc8c0 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -18,24 +18,11 @@ module Sys import Base.Sys: which, isexecutable BINDIR = Base.Sys.BINDIR end +import Base.MathConstants include("compatmacro.jl") -# 0.7.0-DEV.1592 -@static if !isdefined(Base, :MathConstants) - @eval module MathConstants - # All other ones are already exported by Base (so should be already in the users namespace) - # and will be automatically be in this module. - export ℯ - const ℯ = e - end - const ℯ = e - export ℯ -else - import Base.MathConstants -end - # 0.7.0-DEV.1535 @static if !isdefined(Base, :partialsort) const partialsort = select diff --git a/test/old.jl b/test/old.jl index 365abfd67..23e15f3c9 100644 --- a/test/old.jl +++ b/test/old.jl @@ -58,6 +58,19 @@ let sep = Compat.Sys.iswindows() ? ';' : ':' end end +# 0.7 +module TestMathConstants +using Compat.MathConstants +end +for name in [:π, :pi, :ℯ, :e, :γ, :eulergamma, :catalan, :φ, :golden] + @test isdefined(TestMathConstants, name) && !Base.isdeprecated(TestMathConstants, name) + @test isdefined(Compat.MathConstants, name) && !Base.isdeprecated(Compat.MathConstants, name) +end +module TestMathConstants2 +using Compat +end +@test isdefined(TestMathConstants2, :ℯ) && !Base.isdeprecated(TestMathConstants, :ℯ) + # tests of removed functionality (i.e. justs tests Base) diff --git a/test/runtests.jl b/test/runtests.jl index 84ab08d99..938776921 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -103,19 +103,6 @@ end # 0.7 @test isa(1:2, AbstractRange) -# 0.7 -module TestMathConstants -using Compat.MathConstants -end -for name in [:π, :pi, :ℯ, :e, :γ, :eulergamma, :catalan, :φ, :golden] - @test isdefined(TestMathConstants, name) && !Base.isdeprecated(TestMathConstants, name) - @test isdefined(Compat.MathConstants, name) && !Base.isdeprecated(Compat.MathConstants, name) -end -module TestMathConstants2 -using Compat -end -@test isdefined(TestMathConstants2, :ℯ) && !Base.isdeprecated(TestMathConstants, :ℯ) - # 0.7 @test partialsort([3,6,30,1,9], 2, rev=true) == 9 @test partialsort([3,6,30,1,9], 2, by=x->1/x) == 9