Использование methodswith
:
help?> methodswith
search: methodswith
methodswith(typ[, module or function]; supertypes::Bool=false])
Return an array of methods with an argument of type typ.
The optional second argument restricts the search to a particular module or function (the default is all top-level modules).
If keyword supertypes is true, also return arguments with a parent type of typ, excluding type Any.
Пример использования:
julia> methodswith(String, Base)
[1] ==(a::String, b::String) in Base at strings/string.jl:106
[2] abspath(a::String) in Base.Filesystem at path.jl:383
[3] ascii(s::String) in Base at strings/util.jl:612
[4] chomp(s::String) in Base at strings/util.jl:125
[5] cmp(a::String, b::String) in Base at strings/string.jl:100
[6] codeunit(s::String) in Base at strings/string.jl:86
[7] codeunit(s::String, i::Integer) in Base at strings/string.jl:89
[8] dump(io::IOContext, x::String, n::Int64, indent) in Base at show.jl:1942
...
Обратите внимание, что в Джулии очень часто несколько методов определены для абстрактных супертипов, поэтому часто стоит использовать supertypes
параметр как в:
methodswith(Dict, Base, supertypes=true)