-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
gh-106318: Improve str.rstrip() method doc #143893
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
base: main
Are you sure you want to change the base?
Conversation
…method doc str.removesuffix() docs have their own examples.
Co-authored-by: Victor Stinner <vstinner@python.org>
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
Doc/library/stdtypes.rst
Outdated
|
|
||
| See :meth:`str.removesuffix` for a method that will remove a single suffix | ||
| string rather than all of a set of characters. For example:: | ||
| See also :meth:`strip` and :meth:`removesuffix`. |
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.
We should keep the original for these lines.
- it is eye-catching and surprising
- It shows the two methods side-by-side.
- it honors our forebearers.
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.
I agree. I like these 'Monty Python' examples, I would also prefer to keep them.
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. With other improvements.
…split() method doc" This reverts commit 9fa3ecc. As asked by @nedbat on pythongh-143893
WIP to #106318
#106318: Improve str.rstrip() method doc
📚 Documentation preview 📚: https://cpython-previews--143893.org.readthedocs.build/