Skip to content

Commit b1427cb

Browse files
authored
fix variance
1 parent 711fe53 commit b1427cb

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

stdlib/_heapq.pyi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
import sys
2-
from _typeshed import ( # All type variable use in this module requires comparability.
3-
SupportsRichComparison,
4-
SupportsRichComparisonT as _T,
5-
)
2+
from _typeshed import SupportsRichComparisonT as _T # All type variable use in this module requires comparability.
63
from typing import Final
74

85
__about__: Final[str]
96

10-
def heapify(heap: list[SupportsRichComparison], /) -> None: ...
7+
def heapify(heap: list[_T], /) -> None: ... # To work around the fact that list is invariant
118
def heappop(heap: list[_T], /) -> _T: ...
129
def heappush(heap: list[_T], item: _T, /) -> None: ...
1310
def heappushpop(heap: list[_T], item: _T, /) -> _T: ...
1411
def heapreplace(heap: list[_T], item: _T, /) -> _T: ...
1512

1613
if sys.version_info >= (3, 14):
17-
def heapify_max(heap: list[SupportsRichComparison], /) -> None: ...
14+
def heapify_max(heap: list[_T], /) -> None: ...
1815
def heappop_max(heap: list[_T], /) -> _T: ...
1916
def heappush_max(heap: list[_T], item: _T, /) -> None: ...
2017
def heappushpop_max(heap: list[_T], item: _T, /) -> _T: ...

0 commit comments

Comments
 (0)