MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_module_name

Function get_module_name

scripts/update_lib/file_utils.py:198–205  ·  view source on GitHub ↗

Extract module name from path, handling __init__.py.

(path: pathlib.Path)

Source from the content-addressed store, hash-verified

196
197
198def get_module_name(path: pathlib.Path) -> str:
199 """Extract module name from path, handling __init__.py."""
200 if path.suffix == ".py":
201 name = path.stem
202 if name == "__init__":
203 return path.parent.name
204 return name
205 return path.name
206
207
208def get_cpython_dir(src_path: pathlib.Path) -> pathlib.Path:

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected