From 7f9a9a0a9c7084c859e3dc0a6ce10db2ff5c7700 Mon Sep 17 00:00:00 2001 From: ebonnal Date: Thu, 16 Jan 2025 18:22:29 +0100 Subject: [PATCH] `.skip`/`.distinct`: fix genericity of return type --- streamable/stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streamable/stream.py b/streamable/stream.py index ef871ff..3345865 100644 --- a/streamable/stream.py +++ b/streamable/stream.py @@ -165,7 +165,7 @@ def display(self, level: int = logging.INFO) -> "Stream[T]": def distinct( self, key: Optional[Callable[[T], Any]] = None, consecutive_only: bool = False - ) -> "Stream": + ) -> "Stream[T]": """ Filters the stream to yield only distinct elements. If a deduplication `key` is specified, `foo` and `bar` are treated as duplicates when `key(foo) == key(bar)`. @@ -429,7 +429,7 @@ def observe(self, what: str = "elements") -> "Stream[T]": """ return ObserveStream(self, what) - def skip(self, count: int) -> "Stream": + def skip(self, count: int) -> "Stream[T]": """ Skips the first `count` elements.