Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for trace -> tr rename #614

Merged
merged 2 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ Currently, the `@compat` macro supports the following syntaxes:
* `Complex32`, `Complex64`, and `Complex128` are now `ComplexF16`, `ComplexF32`, and
`ComplexF64`, respectively ([#24647]).

* `trace` is now `tr`, available as `Compat.tr` (#26365).

* `JULIA_HOME` is now `Sys.BINDIR`, available in the `Compat.Sys` submodule. ([#25102])

* `Associative` is now `AbstractDict` ([#25012]).
Expand Down Expand Up @@ -546,6 +548,7 @@ includes this fix. Find the minimum version from there.
[#26156]: https://github.com/JuliaLang/julia/issues/26156
[#26283]: https://github.com/JuliaLang/julia/issues/26283
[#26316]: https://github.com/JuliaLang/julia/issues/26316
[#26365]: https://github.com/JuliaLang/julia/issues/26365
[#26369]: https://github.com/JuliaLang/julia/issues/26369
[#26436]: https://github.com/JuliaLang/julia/issues/26436
[#26442]: https://github.com/JuliaLang/julia/issues/26442
Expand Down
8 changes: 8 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,14 @@ end
export ComplexF64
end

# julia #26365
@static if isdefined(LinearAlgebra, :tr)
const tr = LinearAlgebra.tr
else
# 0.6
const tr = LinearAlgebra.trace
end

# 0.7.0-DEV.2915
module Unicode
export graphemes, textwidth, isvalid,
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ let s = "Koala test: 🐨"
end
end

# julia#26365
@test Compat.tr([1 2; 3 5]) == 6

let
x = view(1:10, 2:4)
D = Diagonal(x)
Expand Down