diff options
| author | Yuval Adam <_@yuv.al> | 2025-03-21 22:33:33 +0100 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2025-03-21 22:33:33 +0100 |
| commit | 24e91b9e1b363a75a98afe48c3ec94b5874226e0 (patch) | |
| tree | 8442996f4da6eba096f1cf1269e066a33ba0c2a2 | |
| parent | ba6b6dc1d31aac87cd3469804e5f72ae524ee248 (diff) | |
Cleanup formatting
| -rw-r--r-- | rivulet/pipeline.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/rivulet/pipeline.py b/rivulet/pipeline.py index 226a645..6efd821 100644 --- a/rivulet/pipeline.py +++ b/rivulet/pipeline.py @@ -1,8 +1,9 @@ -from typing import AsyncGenerator, TypeVar, Callable, List, Generic, Any +from typing import AsyncGenerator, TypeVar, Callable, List, Any + +T = TypeVar("T") +U = TypeVar("U") +V = TypeVar("V") -T = TypeVar('T') -U = TypeVar('U') -V = TypeVar('V') class Pipeline: """ @@ -14,9 +15,14 @@ class Pipeline: def __init__(self, source: AsyncGenerator[Any, None]): """Initialize the pipeline with a source async generator.""" self.source = source - self.steps: List[Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]]] = [] + self.steps: List[ + Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]] + ] = [] - def add_step(self, transform: Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]]): + def add_step( + self, + transform: Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]], + ): """ Add a transformation step to the pipeline. @@ -60,4 +66,4 @@ class Pipeline: results = [] async for item in self: results.append(item) - return results
\ No newline at end of file + return results |
