from pathlib import Path def list_files(folder_path: str | Path) -> list[Path]: folder = Path(folder_path) if not folder.is_dir(): raise NotADirectoryError(f"{folder} není platná složka.") return [file_path for file_path in folder.rglob("*") if file_path.is_file()]