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

Function read_python_files

scripts/update_lib/file_utils.py:47–52  ·  view source on GitHub ↗

Read all Python files from a path, yielding (path, content) pairs.

(path: pathlib.Path)

Source from the content-addressed store, hash-verified

45
46
47def read_python_files(path: pathlib.Path) -> Iterator[tuple[pathlib.Path, str]]:
48 """Read all Python files from a path, yielding (path, content) pairs."""
49 for py_file in iter_python_files(path):
50 content = safe_read_text(py_file)
51 if content is not None:
52 yield py_file, content
53
54
55# === Path utilities ===

Callers 3

count_todo_in_pathFunction · 0.90
get_all_importsFunction · 0.90
get_test_dependenciesFunction · 0.90

Calls 2

iter_python_filesFunction · 0.85
safe_read_textFunction · 0.85

Tested by

no test coverage detected