Check module functions and method definitions


#1

Are there functions to check module functions and method definitions?


#2

Please clarify what “check” means in this context. Do you mean unit tests?


#3

If you are in the REPL, you can type

julia> ModuleName.

And then press the ‘tab’ key twice, you will get a list of all methods in that module.

There is also the methods(..) method.


#4

True, I should have clarified. @chakravala interpreted my request correctly.


#5

How does methods(...) work?


#6
help?> methods
search: methods methodswith method_exists Method MethodTable MethodError

  methods(f, [types])

  Returns the method table for f.

  If types is specified, returns an array of methods whose types match.

julia> methods(mean)
# 6 methods for generic function "mean":
mean(r::Range{#s45} where #s45<:Real) in Base at range.jl:858
mean(f::Union{Function, Type}, A::AbstractArray) in Base at statistics.jl:35
mean(f::Union{Function, Type}, iterable) in Base at statistics.jl:19
mean(A::AbstractArray) in Base at statistics.jl:36
mean(A::AbstractArray{T,N} where N, region) where T in Base at statistics.jl:57
mean(iterable) in Base at statistics.jl:34