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

Method _update_ns_ancestors

mypy/modulefinder.py:372–378  ·  view source on GitHub ↗
(self, components: list[str], match: tuple[str, bool])

Source from the content-addressed store, hash-verified

370 return ModuleNotFoundReason.NOT_FOUND
371
372 def _update_ns_ancestors(self, components: list[str], match: tuple[str, bool]) -> None:
373 path, verify = match
374 for i in range(1, len(components)):
375 pkg_id = ".".join(components[:-i])
376 if pkg_id not in self.ns_ancestors and self.fscache.isdir(path):
377 self.ns_ancestors[pkg_id] = path
378 path = os.path.dirname(path)
379
380 def _can_find_module_in_parent_dir(self, id: str) -> bool:
381 """Test if a module can be found by checking the parent directories

Callers 1

_find_moduleMethod · 0.95

Calls 4

rangeClass · 0.85
lenFunction · 0.85
joinMethod · 0.45
isdirMethod · 0.45

Tested by

no test coverage detected