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

Function iter_python_files

scripts/update_lib/file_utils.py:39–44  ·  view source on GitHub ↗

Yield Python files from a file or directory.

(path: pathlib.Path)

Source from the content-addressed store, hash-verified

37
38
39def iter_python_files(path: pathlib.Path) -> Iterator[pathlib.Path]:
40 """Yield Python files from a file or directory."""
41 if path.is_file():
42 yield path
43 else:
44 yield from path.glob("**/*.py")
45
46
47def read_python_files(path: pathlib.Path) -> Iterator[tuple[pathlib.Path, str]]:

Callers 1

read_python_filesFunction · 0.85

Calls 2

is_fileMethod · 0.45
globMethod · 0.45

Tested by

no test coverage detected