Improve docstring

This commit is contained in:
Raymond Hettinger 2012-04-27 00:20:39 -07:00
parent 51a5ad43b5
commit a68bdc720a
1 changed files with 6 additions and 7 deletions

View File

@ -59,7 +59,8 @@ bisect_right(PyObject *self, PyObject *args, PyObject *kw)
}
PyDoc_STRVAR(bisect_right_doc,
"bisect_right(a, x[, lo[, hi]]) -> index\n\
"bisect(a, x[, lo[, hi]]) -> index\n\
bisect_right(a, x[, lo[, hi]]) -> index\n\
\n\
Return the index where to insert item x in list a, assuming a is sorted.\n\
\n\
@ -100,7 +101,8 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
}
PyDoc_STRVAR(insort_right_doc,
"insort_right(a, x[, lo[, hi]])\n\
"insort(a, x[, lo[, hi]])\n\
insort_right(a, x[, lo[, hi]])\n\
\n\
Insert item x in list a, and keep it sorted assuming a is sorted.\n\
\n\
@ -213,18 +215,15 @@ If x is already in a, insert it to the left of the leftmost x.\n\
Optional args lo (default 0) and hi (default len(a)) bound the\n\
slice of a to be searched.\n");
PyDoc_STRVAR(bisect_doc, "Alias for bisect_right().\n");
PyDoc_STRVAR(insort_doc, "Alias for insort_right().\n");
static PyMethodDef bisect_methods[] = {
{"bisect_right", (PyCFunction)bisect_right,
METH_VARARGS|METH_KEYWORDS, bisect_right_doc},
{"bisect", (PyCFunction)bisect_right,
METH_VARARGS|METH_KEYWORDS, bisect_doc},
METH_VARARGS|METH_KEYWORDS, bisect_right_doc},
{"insort_right", (PyCFunction)insort_right,
METH_VARARGS|METH_KEYWORDS, insort_right_doc},
{"insort", (PyCFunction)insort_right,
METH_VARARGS|METH_KEYWORDS, insort_doc},
METH_VARARGS|METH_KEYWORDS, insort_right_doc},
{"bisect_left", (PyCFunction)bisect_left,
METH_VARARGS|METH_KEYWORDS, bisect_left_doc},
{"insort_left", (PyCFunction)insort_left,