Read all Python files from a path, yielding (path, content) pairs.
(path: pathlib.Path)
| 45 | |
| 46 | |
| 47 | def 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 === |
no test coverage detected