Skip to content

Commit b11dd5d

Browse files
committed
Add axes
1 parent 2ae7892 commit b11dd5d

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
@@ -255,6 +255,8 @@ Currently, the `@compat` macro supports the following syntaxes:
255255

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

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

260262
* `@__DIR__` has been added ([#18380])
@@ -408,3 +410,4 @@ includes this fix. Find the minimum version from there.
408410
[#25012]: https://github.com/JuliaLang/julia/issues/25012
409411
[#25021]: https://github.com/JuliaLang/julia/issues/25021
410412
[#25056]: https://github.com/JuliaLang/julia/issues/25056
413+
[#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
@@ -988,6 +988,12 @@ end
988988
export AbstractDict
989989
end
990990

991+
# 0.7.0-DEV.2978
992+
@static if !isdefined(Base, :axes)
993+
const axes = Base.indices
994+
export axes
995+
end
996+
991997
include("deprecated.jl")
992998

993999
end # module Compat

test/runtests.jl

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

1031+
# 0.7.0-DEV.2978
1032+
@test axes === (isdefined(Base, :axes) ? Base.axes : Base.indices)
1033+
@test axes(1) == ()
1034+
@test axes(1,1) == 1:1
1035+
10311036
if VERSION < v"0.6.0"
10321037
include("deprecated.jl")
10331038
end

0 commit comments

Comments
 (0)