workspace
should provide a way to detect already-initialized modules
#16467
Labels
Milestone
workspace
should provide a way to detect already-initialized modules
#16467
For some C libraries (see JuliaIO/Blosc.jl#19), it is not safe to initialize them more than once, nor do we want to register an
atexit
hook more than once. However, if you do aworkspace()
then re-import the module, its__init__
is called a second time. It would be good to have a documented way to check whether a module was already initialized in a previous workspace.(It's not sufficient to look at
LastMain
because the user could callworkspace()
twice.)For example, there could be some kind of
module_init_called(modulename)
function that looks up a module in a global list of initialized modules that persists acrossworkspace
calls.The text was updated successfully, but these errors were encountered: