-
-
Notifications
You must be signed in to change notification settings - Fork 34k
gh-106318: Add example for str.rindex() method #143887
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
Conversation
|
|
||
| .. doctest:: | ||
|
|
||
| >>> 'spam, spam, spam'.rindex('eggs') |
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.
Can you add a successful example, like looking for spam?
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.
Sure.
But I did it this way to be in line with str.index, which doesn't have a successful example.
Should I add it there as well?
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.
But I did it this way to be in line with str.index, which doesn't have a successful example. Should I add it there as well?
Yes, I suggest to also add a successful example in str.index().
Try to use the same input string for both examples.
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.
Done here.
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.
You didn't add a successful example to str.index().
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.
It is a new PR: #144408
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.
It doesn't deserve a whole new PR. Please change it in this PR.
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.
All done.
vstinner
left a comment
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.
LGTM
|
Oh. "Tests / All required checks pass" CI failed with:
Let me try to update the branch. |
|
Thanks @adorilson for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commit 45d00a0) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
(cherry picked from commit 45d00a0) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
GH-144421 is a backport of this pull request to the 3.14 branch. |
|
GH-144422 is a backport of this pull request to the 3.13 branch. |
…144421) gh-106318: Add examples for str.rindex() method (GH-143887) (cherry picked from commit 45d00a0) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
…144422) gh-106318: Add examples for str.rindex() method (GH-143887) (cherry picked from commit 45d00a0) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
Merged, thanks. |
Co-authored-by: Victor Stinner <[email protected]>
WIP to #106318
#106318: Add examples for str.rindex() method
📚 Documentation preview 📚: https://cpython-previews--143887.org.readthedocs.build/