bisect: fix availability, consistency, reduce duplication (#4028)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2020-05-17 08:52:37 -07:00
committed by GitHub
parent 462a3e9dcd
commit 26566af893
4 changed files with 3 additions and 18 deletions

View File

@@ -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: ...

View File

@@ -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

View File

@@ -1,5 +1,3 @@
_bisect.bisect
_bisect.insort
_tracemalloc._get_object_traceback
_tracemalloc.start
asyncio.AbstractEventLoop.sock_sendfile

View File

@@ -1,5 +1,3 @@
_bisect.bisect
_bisect.insort
_thread.ExceptHookArgs
_thread._ExceptHookArgs
_tracemalloc._get_object_traceback