Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
adorilson wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromadorilson:106318.rindex

Conversation

@adorilson
Copy link
Contributor

@adorilsonadorilson commentedJan 15, 2026
edited by github-actionsbot
Loading

WIP to#106318

#106318: Add examples for str.rindex() method


📚 Documentation preview 📚:https://cpython-previews--143887.org.readthedocs.build/


.. doctest::

>>> 'spam, spam, spam'.rindex('eggs')
Copy link
Member

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 forspam?

Copy link
ContributorAuthor

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 withstr.index, which doesn't have a successful example.

Should I add it there as well?

Copy link
Member

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.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done here.

Copy link
Member

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().

Copy link
ContributorAuthor

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

Copy link
Member

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner left review comments

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@adorilson@vstinner

[8]ページ先頭

©2009-2026 Movatter.jp