Files
Chest a5714116ac +full refactor
+feat: configuration, progress bar, OSV
2026-01-18 13:54:14 +03:00

15 lines
381 B
Python

from __future__ import annotations
from typing import Iterable, Iterator, Optional, TypeVar
T = TypeVar("T")
def progress(iterable: Iterable[T], *, total: Optional[int] = None, desc: str = "") -> Iterator[T]:
try:
from tqdm import tqdm # type: ignore
return iter(tqdm(iterable, total=total, desc=desc))
except Exception:
return iter(iterable)