Skip to content

Commit f2ce1d1

Browse files
authored
bisect: insort_* expects x to match type of elements of a (#7102)
1 parent beac964 commit f2ce1d1

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

stdlib/_bisect.pyi

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import SupportsRichComparisonT
2+
from _typeshed import SupportsRichComparison, SupportsRichComparisonT
33
from typing import Callable, MutableSequence, Sequence, TypeVar, overload
44

55
_T = TypeVar("_T")
@@ -27,27 +27,21 @@ if sys.version_info >= (3, 10):
2727
*,
2828
key: Callable[[_T], SupportsRichComparisonT] = ...,
2929
) -> int: ...
30-
@overload
31-
def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: None = ...) -> None: ...
32-
@overload
3330
def insort_left(
3431
a: MutableSequence[_T],
35-
x: SupportsRichComparisonT,
32+
x: _T,
3633
lo: int = ...,
3734
hi: int | None = ...,
3835
*,
39-
key: Callable[[_T], SupportsRichComparisonT] = ...,
36+
key: Callable[[_T], SupportsRichComparison] | None = ...,
4037
) -> None: ...
41-
@overload
42-
def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: None = ...) -> None: ...
43-
@overload
4438
def insort_right(
4539
a: MutableSequence[_T],
46-
x: SupportsRichComparisonT,
40+
x: _T,
4741
lo: int = ...,
4842
hi: int | None = ...,
4943
*,
50-
key: Callable[[_T], SupportsRichComparisonT] = ...,
44+
key: Callable[[_T], SupportsRichComparison] | None = ...,
5145
) -> None: ...
5246

5347
else:

0 commit comments

Comments
 (0)