]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update bisect docstrings (GH-26548)
authorhrchu <petertc.chu@gmail.com>
Sun, 6 Jun 2021 18:22:48 +0000 (02:22 +0800)
committerGitHub <noreply@github.com>
Sun, 6 Jun 2021 18:22:48 +0000 (11:22 -0700)
Modules/_bisectmodule.c
Modules/clinic/_bisectmodule.c.h

index 2d7c15bc1744b6321aee2fbc0f4c684948abb4cd..aa63b685609cc0a597c273ff6fbb2e5383b69067 100644 (file)
@@ -73,8 +73,8 @@ _bisect.bisect_right -> Py_ssize_t
 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(i, 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.
@@ -83,7 +83,7 @@ slice of a to be searched.
 static Py_ssize_t
 _bisect_bisect_right_impl(PyObject *module, PyObject *a, PyObject *x,
                           Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
-/*[clinic end generated code: output=3a4bc09cc7c8a73d input=1313e9ca20c8bc3c]*/
+/*[clinic end generated code: output=3a4bc09cc7c8a73d input=40fcc5afa06ae593]*/
 {
     return internal_bisect_right(a, x, lo, hi, key);
 }
@@ -199,8 +199,8 @@ _bisect.bisect_left -> Py_ssize_t
 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(i, 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.
@@ -209,7 +209,7 @@ slice of a to be searched.
 static Py_ssize_t
 _bisect_bisect_left_impl(PyObject *module, PyObject *a, PyObject *x,
                          Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
-/*[clinic end generated code: output=70749d6e5cae9284 input=3cbeec690f2f6c6e]*/
+/*[clinic end generated code: output=70749d6e5cae9284 input=90dd35b50ceb05e3]*/
 {
     return internal_bisect_left(a, x, lo, hi, key);
 }
index 304e46cf158a749cb1ab3be23c390d9337200337..f118f4bbf86288169bb037630c4d76da4facb625 100644 (file)
@@ -9,8 +9,8 @@ PyDoc_STRVAR(_bisect_bisect_right__doc__,
 "Return the index where to insert item x in list a, assuming a is sorted.\n"
 "\n"
 "The return value i is such that all e in a[:i] have e <= x, and all e in\n"
-"a[i:] have e > x.  So if x already appears in the list, i points just\n"
-"beyond the rightmost x already there\n"
+"a[i:] have e > x.  So if x already appears in the list, a.insert(i, x) will\n"
+"insert just after the rightmost x already there.\n"
 "\n"
 "Optional args lo (default 0) and hi (default len(a)) bound the\n"
 "slice of a to be searched.");
@@ -172,8 +172,8 @@ PyDoc_STRVAR(_bisect_bisect_left__doc__,
 "Return the index where to insert item x in list a, assuming a is sorted.\n"
 "\n"
 "The return value i is such that all e in a[:i] have e < x, and all e in\n"
-"a[i:] have e >= x.  So if x already appears in the list, i points just\n"
-"before the leftmost x already there.\n"
+"a[i:] have e >= x.  So if x already appears in the list, a.insert(i, x) will\n"
+"insert just before the leftmost x already there.\n"
 "\n"
 "Optional args lo (default 0) and hi (default len(a)) bound the\n"
 "slice of a to be searched.");
@@ -327,4 +327,4 @@ skip_optional_kwonly:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=b3a5be025aa4ed7e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aeb97db6db79bf96 input=a9049054013a1b77]*/