summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorMariatta <Mariatta@users.noreply.github.com>2017-04-09 22:17:06 (GMT)
committerGitHub <noreply@github.com>2017-04-09 22:17:06 (GMT)
commit577fc04a7157f6e904cffd6a0e1ad83d3460acd6 (patch)
treecd938d60f9bd206853f110fd6ae5c55d8be73c15 /Objects/unicodeobject.c
parent90eb7a9ff4ce38b5c4e3662bdd42a0ed513893a2 (diff)
downloadcpython-577fc04a7157f6e904cffd6a0e1ad83d3460acd6.zip
cpython-577fc04a7157f6e904cffd6a0e1ad83d3460acd6.tar.gz
cpython-577fc04a7157f6e904cffd6a0e1ad83d3460acd6.tar.bz2
[3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)
(cherry picked from commit 43ba8861e0ad044efafa46a7cc04e12ac5df640e)
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 949205a..7871043 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -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)