Skip to content

Commit

Permalink
address concerns that depwarn for transpose is unclear (JuliaLang#19205)
Browse files Browse the repository at this point in the history
* close JuliaLang#18320

* Update NEWS.md

* Update deprecated.jl

* Update deprecated.jl
  • Loading branch information
cjprybol authored and fcard committed Feb 28, 2017
1 parent e228b4c commit c1feb45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,9 @@ Deprecated or removed
* Sparse matrix functions `etree`, `ereach`, `csc_permute`, and `symperm` have been moved
to the [SuiteSparse.jl package](https://github.com/JuliaSparse/SuiteSparse.jl) ([#12231], [#17033]).

* The no-op `transpose` fallback has been deprecated. Consider introducing suitable
`transpose` methods or calling `permutedims(x, [2,1])` ([#13171], [#17075], [#17374]).
* The no-op `transpose` fallback for non-numeric arrays has been deprecated. Consider introducing suitable
`transpose` methods or calling `permutedims(x, (2, 1))` for matrices and `reshape(x, 1, length(x))` for
vectors. ([#13171], [#17075], [#17374]).

* The following macros have been deprecated ([#16219]):
* `@windows` is deprecated in favor of `is_windows()`
Expand Down
7 changes: 4 additions & 3 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,10 @@ end

# Deprecate no-op transpose fallback. Please see #13171 and #17075.
function transpose(x)
depwarn(string("the no-op `transpose` fallback is deprecated, and no more specific ",
"`transpose` method for $(typeof(x)) exists. Consider `permutedims(x, [2, 1])` ",
"or writing a specific `transpose(x::$(typeof(x)))` method if appropriate."),
depwarn(string("the no-op `transpose` for non-numeric arrays is deprecated, ",
"and no specific `transpose` method for $(typeof(x)) exists. Use ",
"`permutedims(x, (2, 1))` for matrices and `reshape(x, 1, length(x))` for vectors, ",
"or write a specific `transpose(x::$(typeof(x)))` method if appropriate."),
:transpose)
return x
end
Expand Down

0 comments on commit c1feb45

Please sign in to comment.