mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
SF Patch #864863: Bisect C implementation
(Contributed by Dmitry Vasiliev.)
This commit is contained in:
parent
23a0f4ed21
commit
0c4102760c
9 changed files with 261 additions and 16 deletions
|
@ -76,3 +76,9 @@ def bisect_left(a, x, lo=0, hi=None):
|
|||
if a[mid] < x: lo = mid+1
|
||||
else: hi = mid
|
||||
return lo
|
||||
|
||||
# Overwrite above definitions with a fast C implementation
|
||||
try:
|
||||
from _bisect import bisect_right, bisect_left, insort_left, insort_right, insort, bisect
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue