MCPcopy Index your code
hub / github.com/python/mypy / find_module_simple

Function find_module_simple

mypy/build.py:3861–3870  ·  view source on GitHub ↗

Find a filesystem path for module `id` or `None` if not found.

(id: str, manager: BuildManager)

Source from the content-addressed store, hash-verified

3859
3860
3861def find_module_simple(id: str, manager: BuildManager) -> str | None:
3862 """Find a filesystem path for module `id` or `None` if not found."""
3863 if manager.stats_enabled:
3864 t0 = time.time()
3865 x = manager.find_module_cache.find_module(id, fast_path=True)
3866 if manager.stats_enabled:
3867 manager.add_stats(find_module_time=time.time() - t0, find_module_calls=1)
3868 if isinstance(x, ModuleNotFoundReason):
3869 return None
3870 return x
3871
3872
3873def find_module_with_reason(id: str, manager: BuildManager) -> ModuleSearchResult:

Callers 4

is_moduleMethod · 0.85
exist_added_packagesFunction · 0.85
exist_removed_submodulesFunction · 0.85
load_graphFunction · 0.85

Calls 3

isinstanceFunction · 0.85
add_statsMethod · 0.80
find_moduleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…