mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +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
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
_bisect.bisect
|
||||
_bisect.insort
|
||||
_tracemalloc._get_object_traceback
|
||||
_tracemalloc.start
|
||||
asyncio.AbstractEventLoop.sock_sendfile
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
_bisect.bisect
|
||||
_bisect.insort
|
||||
_thread.ExceptHookArgs
|
||||
_thread._ExceptHookArgs
|
||||
_tracemalloc._get_object_traceback
|
||||
|
||||
Reference in New Issue
Block a user