Difference import
vs using
:
import MLJModelInterface
only brings the module into scope, but none of its exported symbols. You can access all symbols from that module by prefixing them withMLJModelInterface.
using MLJModelInterface
brings in all exported symbols of that module in the current one. You can still access non-exported symbols fromMLJModelInterface
as you would when you just would haveimport
ed it
import
and using
act on a Module basis.
If you have a module like
module ABC
include("utils.jl")
end
and
# utils.jl
import MLJModelInterface as MMI
then MLJModelInterface
will be made available also in ABC
.
You can think of include(...)
as ‘copy-pasting’ the code into the place where the include
appeared.