mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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:
parent
b8f2274985
commit
54e54c6877
19 changed files with 38 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue