[New-bugs-announce] [issue29549] Improve docstring for str.index
Raymond Hettinger
report at bugs.python.org
Mon Feb 13 15:57:22 EST 2017
New submission from Raymond Hettinger:
The docstring for str.index() needs to be synced with the main documentation rather than presuming knowledge of str.find().
Currently it reads:
>>> help(str.index)
Help on method_descriptor:
index(...)
S.index(sub[, start[, end]]) -> int
Like S.find() but raise ValueError when the substring is not found.
And it should read more like str.find:
help(str.find)
Help on method_descriptor:
find(...)
S.find(sub[, start[, end]]) -> int
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
Lisa, it would be great if you could draft-up a patch.
----------
assignee: lisroach
components: Documentation
messages: 287724
nosy: lisroach, rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: Improve docstring for str.index
versions: Python 2.7, Python 3.6, Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29549>
_______________________________________
More information about the New-bugs-announce
mailing list