]> granicus.if.org Git - python/commitdiff
SF 1602378 Clarify docstrings for bisect
authorRaymond Hettinger <python@rcn.com>
Tue, 3 Apr 2007 00:02:11 +0000 (00:02 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 3 Apr 2007 00:02:11 +0000 (00:02 +0000)
Lib/bisect.py

index 152f6c7854f829ad3eca53dadb6d383220e1e1a4..e4a21336f8173689b9e3bc5f0aebca988afaca5b 100644 (file)
@@ -23,8 +23,8 @@ def bisect_right(a, x, lo=0, hi=None):
     """Return the index where to insert item x in list a, assuming a is sorted.
 
     The return value i is such that all e in a[:i] have e <= x, and all e in
-    a[i:] have e > x.  So if x already appears in the list, i points just
-    beyond the rightmost x already there.
+    a[i:] have e > x.  So if x already appears in the list, a.insert(x) will
+    insert just after the rightmost x already there.
 
     Optional args lo (default 0) and hi (default len(a)) bound the
     slice of a to be searched.
@@ -62,8 +62,8 @@ def bisect_left(a, x, lo=0, hi=None):
     """Return the index where to insert item x in list a, assuming a is sorted.
 
     The return value i is such that all e in a[:i] have e < x, and all e in
-    a[i:] have e >= x.  So if x already appears in the list, i points just
-    before the leftmost x already there.
+    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
+    insert just before the leftmost x already there.
 
     Optional args lo (default 0) and hi (default len(a)) bound the
     slice of a to be searched.