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

Function module_from_path

mypy/test/data.py:426–433  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

424
425
426def module_from_path(path: str) -> str:
427 path = re.sub(r"\.pyi?$", "", path)
428 # We can have a mix of Unix-style and Windows-style separators.
429 parts = re.split(r"[/\\]", path)
430 del parts[0]
431 module = ".".join(parts)
432 module = re.sub(r"\.__init__$", "", module)
433 return module
434
435
436@dataclass

Callers 2

run_case_onceMethod · 0.90
setupMethod · 0.85

Calls 2

splitMethod · 0.80
joinMethod · 0.45

Tested by 1

run_case_onceMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…