diff options
| author | Lisa Roach <lisaroach14@gmail.com> | 2017-04-04 22:36:22 -0700 |
|---|---|---|
| committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2017-04-04 22:36:22 -0700 |
| commit | 43ba8861e0ad044efafa46a7cc04e12ac5df640e (patch) | |
| tree | f39fbc3083f506fd8d1ac57bcb690b6f89732edc /Objects/unicodeobject.c | |
| parent | 257b980b316a5206ecf6c23b958e2b7c4df4f3de (diff) | |
| download | cpython-git-43ba8861e0ad044efafa46a7cc04e12ac5df640e.tar.gz | |
bpo-29549: Fixes docstring for str.index (#256)
* Updates B.index documentation.
* Updates str.index documentation, makes it Argument Clinic compatible.
* Removes ArgumentClinic code.
* Finishes string.index documentation.
* Updates string.rindex documentation.
* Documents B.rindex.
Diffstat (limited to 'Objects/unicodeobject.c')
| -rw-r--r-- | Objects/unicodeobject.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d3a7f54d0e..b4145719b8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -11697,7 +11697,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) @@ -12813,7 +12817,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) |
