GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-106318: Improve str.rstrip() method doc by adorilson · Pull Request #143893 · python/cpython

Conversation

@adorilson

@adorilson adorilson commented Jan 15, 2026 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

WIP to #106318

#106318: Improve str.rstrip() method doc

  • Issue: Add examples to docs for str methods #106318

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
adorilson added 2 commits January 15, 2026 20:32
@adorilson
pythongh-106318: Add doctest role to str.rsplit() method
1b401b4
@adorilson
pythongh-106318: Remove str.removesuffix() example from str.rsplit() …
9fa3ecc
…method doc

str.removesuffix() docs have their own examples.
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Jan 15, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Jan 15, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jan 15, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jan 15, 2026
Add examples to docs for str methods #106318
Open
@bedevere-app bedevere-app Bot added the awaiting review label Jan 15, 2026
vstinner
vstinner reviewed Jan 19, 2026
View reviewed changes
Comment thread Doc/library/stdtypes.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@adorilson @vstinner
Update Doc/library/stdtypes.rst
eb31bd6
Co-authored-by: Victor Stinner <[email protected]>
@adorilson
adorilson requested a review from vstinner January 19, 2026 14:24
vstinner
vstinner approved these changes Jan 19, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jan 19, 2026
@StanFromIreland
Merge branch 'main' into 106318.rstrip
3e78e07
nedbat
nedbat reviewed Feb 10, 2026
View reviewed changes
Comment thread 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`.

@nedbat nedbat Feb 10, 2026

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chris-eibl and adorilson reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

@vstinner vstinner Feb 10, 2026

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@adorilson adorilson Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
adorilson added 3 commits February 10, 2026 20:30
@adorilson
Revert "pythongh-106318: Remove str.removesuffix() example from str.r…
25ab03f
…split() method doc"

This reverts commit 9fa3ecc.

As asked by @nedbat on pythongh-143893
@adorilson
pythongh-106318: Add "See also" for str.rstrip() and str.strip() methods
869cdd2
@adorilson
pythongh-106318: Add doctest role for str.strip() method
ae431aa
@adorilson
adorilson requested review from nedbat and vstinner February 10, 2026 20:31
nedbat
nedbat approved these changes Feb 11, 2026
View reviewed changes
@vstinner
vstinner merged commit 936d60d into python:main Feb 11, 2026
29 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Feb 11, 2026
@bedevere-app bedevere-app Bot removed the awaiting merge label Feb 11, 2026
@vstinner

vstinner commented Feb 11, 2026

Copy link
Copy Markdown
Member

Merged, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Feb 11, 2026
@miss-islington-app

miss-islington-app Bot commented Feb 11, 2026

Copy link
Copy Markdown

Thanks @adorilson for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Feb 11, 2026

Copy link
Copy Markdown

Thanks @adorilson for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 11, 2026
@adorilson @vstinner
@StanFromIreland @miss-islington
pythongh-106318: Improve str.rstrip() method doc (pythonGH-143893)
2ac34f1
(cherry picked from commit 936d60d)

Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 11, 2026
@adorilson @vstinner
@StanFromIreland @miss-islington
pythongh-106318: Improve str.rstrip() method doc (pythonGH-143893)
dd2ee87
(cherry picked from commit 936d60d)

Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
@bedevere-app

bedevere-app Bot commented Feb 11, 2026

Copy link
Copy Markdown

GH-144698 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Feb 11, 2026
@bedevere-app

bedevere-app Bot commented Feb 11, 2026

Copy link
Copy Markdown

GH-144699 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Feb 11, 2026
@vstinner

vstinner commented Feb 11, 2026

Copy link
Copy Markdown
Member

Merged, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added a commit that referenced this pull request Feb 11, 2026
@miss-islington @adorilson
@vstinner @StanFromIreland
[3.14] gh-106318: Improve str.rstrip() method doc (GH-143893) (#144699)
a77dde4
gh-106318: Improve str.rstrip() method doc (GH-143893)
(cherry picked from commit 936d60d)

Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
vstinner added a commit that referenced this pull request Feb 11, 2026
@miss-islington @adorilson
@vstinner @StanFromIreland
[3.13] gh-106318: Improve str.rstrip() method doc (GH-143893) (#144698)
a5b1952
gh-106318: Improve str.rstrip() method doc (GH-143893)
(cherry picked from commit 936d60d)

Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@adorilson @vstinner
@StanFromIreland @thunder-coding
pythongh-106318: Improve str.rstrip() method doc (python#143893)
9dc4914
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
@adorilson @vstinner
@StanFromIreland @brijkapadia
pythongh-106318: Improve str.rstrip() method doc (python#143893)
f67040f
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@adorilson @vstinner
@StanFromIreland @ljfp
pythongh-106318: Improve str.rstrip() method doc (python#143893)
0ec54d2
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nedbat nedbat nedbat approved these changes
@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@adorilson @vstinner @nedbat @StanFromIreland
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.