Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify which module a function was exported from in Julia

I'm looking for a way to identify which module a function was exported from in Julia.

like image 615
conjectures Avatar asked Dec 24 '22 12:12

conjectures


2 Answers

You can use <function name>.env.module to retrieve the name of the module which it comes from.

Ex.

julia> sum.env.module
Base
like image 120
Daniel Arndt Avatar answered Jan 13 '23 16:01

Daniel Arndt


The <function name>.env.module approach in the accepted answer no longer works in Julia 1.x. Instead, you can use the @which macro:

julia> using DataFrames

julia> @which sum
Base

julia> @which enumerate
Base.Iterators

julia> @which deleterows!
DataFrames
like image 36
Cameron Bieganek Avatar answered Jan 13 '23 16:01

Cameron Bieganek