SF Patch #864863: Bisect C implementation

(Contributed by Dmitry Vasiliev.)
This commit is contained in:
Raymond Hettinger 2004-01-05 10:13:35 +00:00
parent 23a0f4ed21
commit 0c4102760c
9 changed files with 261 additions and 16 deletions

View file

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