Skip to content

Commit 690864c

Browse files
authored
heapq: re-export, add __about__ (#7308)
1 parent 6b29dca commit 690864c

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extra_standard_library = [
1818
"_compression",
1919
"_csv",
2020
"_curses",
21+
"_heapq",
2122
"_markupbase",
2223
"_random",
2324
"_tkinter",

stdlib/_heapq.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ from typing import Any, TypeVar
22

33
_T = TypeVar("_T")
44

5+
__about__: str
6+
57
def heapify(__heap: list[Any]) -> None: ...
68
def heappop(__heap: list[_T]) -> _T: ...
79
def heappush(__heap: list[_T], __item: _T) -> None: ...

stdlib/heapq.pyi

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1+
from _heapq import *
12
from _typeshed import SupportsRichComparison
23
from typing import Any, Callable, Iterable, TypeVar
34

4-
_T = TypeVar("_T")
5+
_S = TypeVar("_S")
56

6-
def heappush(__heap: list[_T], __item: _T) -> None: ...
7-
def heappop(__heap: list[_T]) -> _T: ...
8-
def heappushpop(__heap: list[_T], __item: _T) -> _T: ...
9-
def heapify(__heap: list[Any]) -> None: ...
10-
def heapreplace(__heap: list[_T], __item: _T) -> _T: ...
11-
def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] | None = ..., reverse: bool = ...) -> Iterable[_T]: ...
12-
def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsRichComparison] | None = ...) -> list[_T]: ...
13-
def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsRichComparison] | None = ...) -> list[_T]: ...
7+
__about__: str
8+
9+
def merge(*iterables: Iterable[_S], key: Callable[[_S], Any] | None = ..., reverse: bool = ...) -> Iterable[_S]: ...
10+
def nlargest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = ...) -> list[_S]: ...
11+
def nsmallest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = ...) -> list[_S]: ...
1412
def _heapify_max(__x: list[Any]) -> None: ... # undocumented

0 commit comments

Comments
 (0)