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

Method load

Lib/importlib/metadata/__init__.py:218–225  ·  view source on GitHub ↗

Load the entry point from its definition. If only a module is indicated by the value, return that module. Otherwise, return the named object.

(self)

Source from the content-addressed store, hash-verified

216 self.module
217
218 def load(self) -> Any:
219 """Load the entry point from its definition. If only a module
220 is indicated by the value, return that module. Otherwise,
221 return the named object.
222 """
223 module = import_module(self.module)
224 attrs = filter(None, (self.attr or '').split('.'))
225 return functools.reduce(getattr, attrs, module)
226
227 @property
228 def module(self) -> str:

Callers 1

Calls 4

import_moduleFunction · 0.90
reduceMethod · 0.80
filterFunction · 0.50
splitMethod · 0.45

Tested by 1