From 94866e0cf8d1c3e8d59757ba360cdaaad9368e1b Mon Sep 17 00:00:00 2001 From: ebonnal Date: Sat, 28 Sep 2024 20:43:26 +0100 Subject: [PATCH] tests: remove tmp commented line --- streamable/iters.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/streamable/iters.py b/streamable/iters.py index 2f7fbaa..3cca9d5 100644 --- a/streamable/iters.py +++ b/streamable/iters.py @@ -364,7 +364,9 @@ def __iter__(self) -> Iterator[Union[U, RaisingIterator.ExceptionContainer]]: futures: Deque["Future[Union[U, RaisingIterator.ExceptionContainer]]"] = ( deque() ) - to_yield: List[Union[U, RaisingIterator.ExceptionContainer]] = [] + to_yield: Deque[Union[U, RaisingIterator.ExceptionContainer]] = deque( + maxlen=1 + ) # wait, queue, yield (FIFO) while True: if futures: @@ -480,8 +482,10 @@ def __init__( def __iter__(self) -> Iterator[Union[T, RaisingIterator.ExceptionContainer]]: with ThreadPoolExecutor(max_workers=self.concurrency) as executor: iterator_and_future_pairs: Deque[Tuple[Iterator[T], Future]] = deque() - element_to_yield: List[Union[T, RaisingIterator.ExceptionContainer]] = [] - iterator_to_queue: List[Iterator[T]] = [] + element_to_yield: Deque[Union[T, RaisingIterator.ExceptionContainer]] = ( + deque(maxlen=1) + ) + iterator_to_queue: Deque[Iterator[T]] = deque(maxlen=1) # wait, queue, yield (FIFO) while True: if iterator_and_future_pairs: