# Finding specific methods in Julia documentation

**URL:** <https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690>\
**Category:** General Usage\
**Created:** [February 15, 2020, 10:28pm UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690 "2020-02-15T22:28:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 15, 2020, 10:28pm UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/1 "2020-02-15T22:28:28Z")

</div>

I’m trying to find the 1.X equivalent for flipdim. The intertubes told me that it had been replaced by reverse with a dims keyword

[https://github.com/JuliaLang/julia/pull/26369](https://github.com/JuliaLang/julia/pull/26369)

Humorously i can’t figure out how it’s supposed to work through the PR. I looked in the documentation through search, and none of the reverse methods that show up are the one I think I’m looking for (incidentally the first one that shows up is for String).

So naturally i ran methods() on reverse and found,

[10] reverse(A::Array{T,N} where N; dims) where T in Base at arraymath.jl:62

But I’m not actually sure the dims in that method is a dims keyword, but it seems likely.

But that didn’t help me located it in the documentation, i.e. i’m searching through the array stuff by hand and not finding it, wondering if maybe it’s in the documentation for an ArrayMath package, or something, because arraymath is not Base.

Hoping someone can teach me to fish.

Thanks.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 15, 2020, 10:34pm UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/2 "2020-02-15T22:34:15Z")

</div>

DOH.

> ```julia
> reverse(A; dims::Integer)
> 
> ```
> 
> Reverse `A` in dimension `dims` .

i think that’s what i was looking for… Correct ?

However, my more general question remains, if I knew that the form was

```julia
reverse(A; dims)

```

is there a way to find the documentation for that specific method ?

---

<div class="post-metadata">

**Author:** ![ea42gh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ea42gh/32/12000_2.png) [@ea42gh](https://discourse.julialang.org/u/ea42gh)\
**Post date:** [February 15, 2020, 11:46pm UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/3 "2020-02-15T23:46:39Z")

</div>

I was struggling with something similar, and was told to run Julia v0.7:  
it gives deprecation warnings.  
Specifically, `A=[1 2; 3 4]; flipdim(A,2)` yields

```julia
┌ Warning: `flipdim(A, d)` is deprecated, use `reverse(A, dims=d)` instead.

```

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 16, 2020, 1:21am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/4 "2020-02-16T01:21:52Z")

</div>

i thought about that, i guess it’s that much trouble to go install an old version.  
also I need to figure out what the “ **.'** ” operator does…

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 16, 2020, 2:12am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/5 "2020-02-16T02:12:08Z")

</div>

Google search? Usually works for me…

---

<div class="post-metadata">

**Author:** ![ea42gh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ea42gh/32/12000_2.png) [@ea42gh](https://discourse.julialang.org/u/ea42gh)\
**Post date:** [February 16, 2020, 2:26am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/6 "2020-02-16T02:26:13Z")

</div>

For me, web search usually does not work. You must be darn good specifying search terms! 🙂

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 16, 2020, 2:30am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/7 "2020-02-16T02:30:53Z")

</div>

clearly something as generic as searching on something as generic as “reverse” is going to be a problem in terms of finding a specific method.

although searching on “reverse keyword dims” did bring up the pull request.

I was thinking something more along the lines of hoogle, where i could put in something like

reverse(Array{Int,1})  
or  
reverse(String)

and it would match the correct method and provide documentation.

Now, that would be cool. I haven’t just volunteered to create that, have I ?? 😆

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 16, 2020, 2:40am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/8 "2020-02-16T02:40:24Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/2/9/295523f78d173828c787c7e6e9d29f9a99fc6918.png)

---

<div class="post-metadata">

**Author:** ![ea42gh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ea42gh/32/12000_2.png) [@ea42gh](https://discourse.julialang.org/u/ea42gh)\
**Post date:** [February 16, 2020, 2:41am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/9 "2020-02-16T02:41:56Z")

</div>

I rest my case!

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 16, 2020, 2:51am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/10 "2020-02-16T02:51:13Z")

</div>

It gets even better with Ecosia:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/e/fe6d80e714b8f16d44165a01ecdec11fe560d068.png)

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [February 16, 2020, 7:52am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/11 "2020-02-16T07:52:20Z")

</div>

> [@purplishrock](#):
>
> However, my more general question remains, if I knew that the form was
> 
> ```julia
> reverse(A; dims)
> 
> ```
> 
> is there a way to find the documentation for that specific method ?

```julia
julia> A = rand(3, 3);

help?> reverse(A; dims=1)
  reverse(A; dims::Integer)

  Reverse A in dimension dims.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> b = [1 2; 3 4]
  2×2 Array{Int64,2}:
   1 2
   3 4
  
  julia> reverse(b, dims=2)
  2×2 Array{Int64,2}:
   2 1
   4 3

```

(end of output)

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [June 16, 2021, 4:25pm UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/12 "2021-06-16T16:25:14Z")

</div>

I find that using `? funcname(a)` to get just the documentation for the relevant method sometimes works and sometimes does not. Is there a rhyme and reason? Or does this need a bug report? For example: `? reverse` prints all doc strings for reverse, as expected. And `s = "cat";` followed by `? reverse(s)` does print only docs for `reverse(::AbstractString)`, which is the desired behavior. But, contrast with the following: `? empty` prints documentation for three methods. Doing `d = Dict(1 => 2);` followed by `? empty(d)` prints documentation for two methods, those for `AbstractDict` and `AbstractVector`. If I load packages on top of those at startup then `? empty(d)` prints even more methods.

I find that the example above, `? empty(d)` gives the same result for versions (modulo beta versions) of Julia 1.5, 1.6, 1.7, 1.8. Searching the issues with queries such as “documentation method repl” doesn’t turn anything up.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 15, 2021, 8:09am UTC](https://discourse.julialang.org/t/finding-specific-methods-in-julia-documentation/34690/13 "2021-07-15T08:09:29Z")

</div>

Indeed that looks like a bug. The MWE is

```julia
Docs.doc(empty, Tuple{Dict})

```

and I could not find an existing issue, so it would be great if you could open one.
