Skip to content

Commit ad1f40c

Browse files
committed
Add axes
1 parent 93a06a5 commit ad1f40c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ Currently, the `@compat` macro supports the following syntaxes:
254254

255255
* `Associative` is now `AbstractDict` ([#25012]).
256256

257+
* `indices` is now `axes` ([#25057]).
258+
257259
## New macros
258260

259261
* `@__DIR__` has been added ([#18380])
@@ -407,3 +409,4 @@ includes this fix. Find the minimum version from there.
407409
[#24785]: https://github.com/JuliaLang/julia/issues/24785
408410
[#25012]: https://github.com/JuliaLang/julia/issues/25012
409411
[#25056]: https://github.com/JuliaLang/julia/issues/25056
412+
[#25057]: https://github.com/JuliaLang/julia/issues/25057

src/Compat.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,12 @@ end
954954
export AbstractDict
955955
end
956956

957+
# 0.7.0-DEV.2978
958+
@static if !isdefined(Base, :axes)
959+
const axes = Base.indices
960+
export axes
961+
end
962+
957963
include("deprecated.jl")
958964

959965
end # module Compat

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,11 @@ end
10161016
# 0.7.0-DEV.2951
10171017
@test AbstractDict === (isdefined(Base, :AbstractDict) ? Base.AbstractDict : Base.Associative)
10181018

1019+
# 0.7.0-DEV.2978
1020+
@test axes === (isdefined(Base, :axes) ? Base.axes : Base.indices)
1021+
@test axes(1) == ()
1022+
@test axes(1,1) == 1:1
1023+
10191024
if VERSION < v"0.6.0"
10201025
include("deprecated.jl")
10211026
end

0 commit comments

Comments
 (0)