[3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)

(cherry picked from commit 43ba8861e0)
This commit is contained in:
Mariatta 2017-04-09 15:17:06 -07:00 committed by GitHub
parent 90eb7a9ff4
commit 577fc04a71
2 changed files with 20 additions and 5 deletions

View file

@ -11701,7 +11701,11 @@ unicode_hash(PyObject *self)
PyDoc_STRVAR(index__doc__,
"S.index(sub[, start[, end]]) -> int\n\
\n\
Like S.find() but raise ValueError when the substring is not found.");
Return the lowest index in S where substring sub is found, \n\
such that sub is contained within S[start:end]. Optional\n\
arguments start and end are interpreted as in slice notation.\n\
\n\
Raises ValueError when the substring is not found.");
static PyObject *
unicode_index(PyObject *self, PyObject *args)
@ -12758,7 +12762,11 @@ unicode_rfind(PyObject *self, PyObject *args)
PyDoc_STRVAR(rindex__doc__,
"S.rindex(sub[, start[, end]]) -> int\n\
\n\
Like S.rfind() but raise ValueError when the substring is not found.");
Return the highest index in S where substring sub is found,\n\
such that sub is contained within S[start:end]. Optional\n\
arguments start and end are interpreted as in slice notation.\n\
\n\
Raises ValueError when the substring is not found.");
static PyObject *
unicode_rindex(PyObject *self, PyObject *args)