How to find to which module a type belongs to?

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

1 Like
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!

1 Like
julia> using StaticArrays

julia> @which SArray
StaticArrays
3 Likes