MCPcopy Index your code
hub / github.com/ipython/ipython / aimport_module

Method aimport_module

IPython/extensions/autoreload.py:228–244  ·  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

226 self.import_from_tracker = ImportFromTracker({}, {})
227
228 def aimport_module(self, module_name):
229 """Import a module, and mark it reloadable
230
231 Returns
232 -------
233 top_module : module
234 The imported module if it is top-level, or the top-level
235 top_name : module
236 Name of top_module
237
238 """
239 self.mark_module_reloadable(module_name)
240
241 import_module(module_name)
242 top_name = module_name.split(".")[0]
243 top_module = sys.modules[top_name]
244 return top_module, top_name
245
246 def filename_and_mtime(self, module):
247 if not hasattr(module, "__file__") or module.__file__ is None:

Callers 1

aimportMethod · 0.80

Calls 1

Tested by

no test coverage detected