Yield Python files from a file or directory.
(path: pathlib.Path)
| 37 | |
| 38 | |
| 39 | def 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 | |
| 47 | def read_python_files(path: pathlib.Path) -> Iterator[tuple[pathlib.Path, str]]: |
no test coverage detected