MCPcopy Create free account
hub / github.com/ipython/ipython / aimport_module

Method aimport_module

IPython/extensions/autoreload.py:165–181  ·  view source on GitHub ↗

Import a module, and mark it reloadable Returns ------- top_module : module The imported module if it is top-level, or the top-level top_name : module Name of top_module

(self, module_name)

Source from the content-addressed store, hash-verified

163 self.modules[module_name] = True
164
165 def aimport_module(self, module_name):
166 """Import a module, and mark it reloadable
167
168 Returns
169 -------
170 top_module : module
171 The imported module if it is top-level, or the top-level
172 top_name : module
173 Name of top_module
174
175 """
176 self.mark_module_reloadable(module_name)
177
178 import_module(module_name)
179 top_name = module_name.split('.')[0]
180 top_module = sys.modules[top_name]
181 return top_module, top_name
182
183 def filename_and_mtime(self, module):
184 if not hasattr(module, '__file__') or module.__file__ is None:

Callers 1

aimportMethod · 0.80

Calls 1

Tested by

no test coverage detected