Skip to content

Commit

Permalink
Mark Compat.MathConstants from #401 for future deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 4322387 commit 31d3068
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 31 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,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]).
Expand Down
15 changes: 1 addition & 14 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
13 changes: 0 additions & 13 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31d3068

Please sign in to comment.