How to find to which module a type belongs to?


#1

Hi fellows,

Let’s assume, I have a type XYZ which i currently use in my current module , however XYZ is defined in some other module. How can i get to which module XYZ belongs to?

Thanks


#2
julia> get_module(name) = eval(parse(string(name)[1:findlast(string(name), '.')-1]))
get_module (generic function with 1 method)

julia> using StaticArrays

julia> get_module(SArray)
StaticArrays

Edit: see below for proper way!


#3
julia> using StaticArrays

julia> @which SArray
StaticArrays