How do I check what module an object is defined in?

Viewed 50

If I have an object (say a method, or a struct, or a Type, imported with using), how can I get the module it was originally defined in?

1 Answers

You can use the parentmodule function. For example:

julia> parentmodule(rand)
Base

julia> parentmodule(versioninfo)
InteractiveUtils
Related