gh-106318: Add example for str.rindex() method#143887
Conversation
|
|
||
| .. doctest:: | ||
|
|
||
| >>> 'spam, spam, spam'.rindex('eggs') |
There was a problem hiding this comment.
Can you add a successful example, like looking for spam?
There was a problem hiding this comment.
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.
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.
You didn't add a successful example to str.index().
There was a problem hiding this comment.
It doesn't deserve a whole new PR. Please change it in this PR.
|
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/