The first batch of changes recommended by the fixdiv tool. These are

mostly changes of / operators into //.  Once or twice I did more or
less than recommended.
This commit is contained in:
Guido van Rossum 2001-09-04 19:14:14 +00:00
parent b8f2274985
commit 54e54c6877
19 changed files with 38 additions and 38 deletions

View file

@ -12,7 +12,7 @@ def insort_right(a, x, lo=0, hi=None):
if hi is None:
hi = len(a)
while lo < hi:
mid = (lo+hi)/2
mid = (lo+hi)//2
if x < a[mid]: hi = mid
else: lo = mid+1
a.insert(lo, x)
@ -33,7 +33,7 @@ def bisect_right(a, x, lo=0, hi=None):
if hi is None:
hi = len(a)
while lo < hi:
mid = (lo+hi)/2
mid = (lo+hi)//2
if x < a[mid]: hi = mid
else: lo = mid+1
return lo
@ -52,7 +52,7 @@ def insort_left(a, x, lo=0, hi=None):
if hi is None:
hi = len(a)
while lo < hi:
mid = (lo+hi)/2
mid = (lo+hi)//2
if a[mid] < x: lo = mid+1
else: hi = mid
a.insert(lo, x)
@ -72,7 +72,7 @@ def bisect_left(a, x, lo=0, hi=None):
if hi is None:
hi = len(a)
while lo < hi:
mid = (lo+hi)/2
mid = (lo+hi)//2
if a[mid] < x: lo = mid+1
else: hi = mid
return lo