Skip to content

Commit

Permalink
stream: overload constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ebonnal committed Jun 7, 2024
1 parent 4768d66 commit 0474283
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions streamable/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@


class Stream(Iterable[T]):
# fmt: off
@overload
def __init__(self, source: Iterable[T]) -> None: ...
@overload
def __init__(self, source: Callable[[], Iterable[T]]) -> None: ...
# fmt: on

def __init__(self, source: Union[Iterable[T], Callable[[], Iterable[T]]]) -> None:
"""
Initialize a Stream with a data source.
Expand Down

0 comments on commit 0474283

Please sign in to comment.