-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-29549: Fixes docstring for str.index #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
982257f
Updates B.index documentation.
lisroach 5860a7f
Updates str.index documentation, makes it Argument Clinic compatible.
lisroach 25e2482
Removes ArgumentClinic code.
lisroach edae59d
Finishes string.index documentation.
lisroach 5e182a6
Updates string.rindex documentation.
lisroach 1e950a2
Documents B.rindex.
lisroach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11687,7 +11687,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\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space before the newline |
||
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) | ||
|
@@ -12803,7 +12807,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) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a colon, not a comma: B[start:end]
(I presume these errors were copied from the “find” and “rfind” doc strings; they could also be fixed there, but at least don’t repeat the errors)