MCPcopy Index your code
hub / github.com/python/cpython / add_module

Function add_module

Lib/test/support/import_helper.py:424–429  ·  view source on GitHub ↗

Return the module after creating it and adding it to sys.modules. If parents is True then also create any missing parents.

(spec, *, parents=True)

Source from the content-addressed store, hash-verified

422
423
424def add_module(spec, *, parents=True):
425 """Return the module after creating it and adding it to sys.modules.
426
427 If parents is True then also create any missing parents.
428 """
429 return _add_module(spec, False, parents)
430
431
432def add_package(spec, *, parents=True):

Callers 1

check_addmoduleMethod · 0.85

Calls 1

_add_moduleFunction · 0.85

Tested by 1

check_addmoduleMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…