Skip to content

Commit

Permalink
Update the docstring and error message for the zip operator
Browse files Browse the repository at this point in the history
  • Loading branch information
vxgmichel committed Jul 21, 2024
1 parent 30665d9 commit 6036eae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiostream/stream/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ async def zip(
their respective sources. The generation continues until the shortest
sequence is exhausted.
With the `strict` argument set to `True`, the operator makes sure that
all the sequences have the same length. If not, a `ValueError` is raised.
Note: the different sequences are awaited in parrallel, so that their
waiting times don't add up.
"""
Expand Down Expand Up @@ -91,7 +94,7 @@ async def zip(
if all(item == STOP_SENTINEL for item in _items):
break
elif any(item == STOP_SENTINEL for item in _items):
raise ValueError("iterables have different lengths")
raise ValueError("The provided sources have different lengths")
# This holds because we've ruled out STOP_SENTINEL above:
items = cast("list[T]", _items)
else:
Expand Down

0 comments on commit 6036eae

Please sign in to comment.