{ } Raw JSON

bundles / IPython 9.17.0 / IPython / lib / deepreload / get_parent

function

IPython.lib.deepreload:get_parent

source: /dev/ipython/IPython/lib/deepreload.py:48

Summary

Return the package that an import is being performed in. If globals comes from the module foo.bar.bat (not itself a package), this returns the sys.modules entry for foo.bar. If globals is from a package's __init__.py, the package's entry in sys.modules is returned.

Extended Summary

If globals doesn't come from a package or a module in a package, or a corresponding entry is not found in sys.modules, None is returned.

Aliases

  • IPython.lib.deepreload.get_parent