Skip to content

Commit 31d3068

Browse files
committed
Mark Compat.MathConstants from #401 for future deprecation
1 parent 4322387 commit 31d3068

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,6 @@ Currently, the `@compat` macro supports the following syntaxes:
225225
* `select`* functions (`select`, `select!`, `selectperm`, `selectperm!`) are renamed to
226226
`partialsort`* (`partialsort`, `partialsort!`, `partialsortperm`, `partialsortperm!`) ([#23051])
227227

228-
* Math constants (`π`, `pi`, `e`, `γ`, `eulergamma`, `catalan`, `φ`, `golden`) are moved to the
229-
`MathConstants` module (available as `Compat.MathConstants`).
230-
The name exported from `Base` for `e` is changed to ``. ([#23427])
231-
232228
* `IntSet` is now `BitSet` ([#24282])
233229

234230
* `strwidth` and `charwidth` are now merged into `textwidth` ([#23667]).

src/Compat.jl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,11 @@ module Sys
1818
import Base.Sys: which, isexecutable
1919
BINDIR = Base.Sys.BINDIR
2020
end
21+
import Base.MathConstants
2122

2223

2324
include("compatmacro.jl")
2425

25-
# 0.7.0-DEV.1592
26-
@static if !isdefined(Base, :MathConstants)
27-
@eval module MathConstants
28-
# All other ones are already exported by Base (so should be already in the users namespace)
29-
# and will be automatically be in this module.
30-
export
31-
const= e
32-
end
33-
const= e
34-
export
35-
else
36-
import Base.MathConstants
37-
end
38-
3926
# 0.7.0-DEV.1535
4027
@static if !isdefined(Base, :partialsort)
4128
const partialsort = select

test/old.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ let sep = Compat.Sys.iswindows() ? ';' : ':'
5858
end
5959
end
6060

61+
# 0.7
62+
module TestMathConstants
63+
using Compat.MathConstants
64+
end
65+
for name in [, :pi, :ℯ, :e, , :eulergamma, :catalan, , :golden]
66+
@test isdefined(TestMathConstants, name) && !Base.isdeprecated(TestMathConstants, name)
67+
@test isdefined(Compat.MathConstants, name) && !Base.isdeprecated(Compat.MathConstants, name)
68+
end
69+
module TestMathConstants2
70+
using Compat
71+
end
72+
@test isdefined(TestMathConstants2, :ℯ) && !Base.isdeprecated(TestMathConstants, :ℯ)
73+
6174

6275
# tests of removed functionality (i.e. justs tests Base)
6376

test/runtests.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,6 @@ end
103103
# 0.7
104104
@test isa(1:2, AbstractRange)
105105

106-
# 0.7
107-
module TestMathConstants
108-
using Compat.MathConstants
109-
end
110-
for name in [, :pi, :ℯ, :e, , :eulergamma, :catalan, , :golden]
111-
@test isdefined(TestMathConstants, name) && !Base.isdeprecated(TestMathConstants, name)
112-
@test isdefined(Compat.MathConstants, name) && !Base.isdeprecated(Compat.MathConstants, name)
113-
end
114-
module TestMathConstants2
115-
using Compat
116-
end
117-
@test isdefined(TestMathConstants2, :ℯ) && !Base.isdeprecated(TestMathConstants, :ℯ)
118-
119106
# 0.7
120107
@test partialsort([3,6,30,1,9], 2, rev=true) == 9
121108
@test partialsort([3,6,30,1,9], 2, by=x->1/x) == 9

0 commit comments

Comments
 (0)