From c38ade5d4df55d359a82eaebd21c41ef2a05c396 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Tue, 18 Mar 2025 15:52:00 +0400 Subject: [PATCH] Use `Generator` for `heapq.merge` --- stdlib/heapq.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/heapq.pyi b/stdlib/heapq.pyi index 7a3aa8b442a5..220c41f303fb 100644 --- a/stdlib/heapq.pyi +++ b/stdlib/heapq.pyi @@ -1,6 +1,6 @@ from _heapq import * from _typeshed import SupportsRichComparison -from collections.abc import Callable, Iterable +from collections.abc import Callable, Generator, Iterable from typing import Any, Final, TypeVar __all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge", "nlargest", "nsmallest", "heappushpop"] @@ -11,7 +11,7 @@ __about__: Final[str] def merge( *iterables: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None, reverse: bool = False -) -> Iterable[_S]: ... +) -> Generator[_S]: ... def nlargest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ... def nsmallest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ... def _heapify_max(heap: list[Any], /) -> None: ... # undocumented