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

Function create_package_from_loader

Lib/test/test_importlib/resources/util.py:55–61  ·  view source on GitHub ↗
(loader, is_package=True)

Source from the content-addressed store, hash-verified

53
54
55def create_package_from_loader(loader, is_package=True):
56 name = 'testingpackage'
57 module = types.ModuleType(name)
58 spec = ModuleSpec(name, loader, origin='does-not-exist', is_package=is_package)
59 module.__spec__ = spec
60 module.__loader__ = loader
61 return module
62
63
64def create_package(file=None, path=None, is_package=True, contents=()):

Callers 1

create_packageFunction · 0.85

Calls 1

ModuleSpecClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…