mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-02 01:23:24 +08:00
bisect: fix availability, consistency, reduce duplication (#4028)
Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
from typing import Sequence, MutableSequence, TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def insort(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
# Stubs for bisect
|
||||
|
||||
from typing import Any, Sequence, MutableSequence, TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
|
||||
def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def insort(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
from _bisect import *
|
||||
bisect = bisect_right
|
||||
insort = insort_right
|
||||
|
||||
Reference in New Issue
Block a user