Skip to content

gh-69619: Clarify str.{l,r}strip() documentation#150901

Open
kyo5uke wants to merge 2 commits into
python:mainfrom
kyo5uke:strip-whitespace-isspace-docs
Open

gh-69619: Clarify str.{l,r}strip() documentation#150901
kyo5uke wants to merge 2 commits into
python:mainfrom
kyo5uke:strip-whitespace-isspace-docs

Conversation

@kyo5uke
Copy link
Copy Markdown

@kyo5uke kyo5uke commented Jun 4, 2026

str.strip() documents that whitespace is defined by str.isspace(), but str.lstrip() and str.rstrip() did not mention it. This adds the same sentence to both so the three methods are described consistently.

Documentation-only change.

Relates to #69619

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented Jun 4, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Jun 4, 2026

Comment thread Doc/library/stdtypes.rst Outdated
@kyo5uke kyo5uke force-pushed the strip-whitespace-isspace-docs branch from 19b8f30 to 94f3a81 Compare June 4, 2026 11:18
@kyo5uke
Copy link
Copy Markdown
Author

kyo5uke commented Jun 4, 2026

Thanks @picnixz! I inlined the note in both str.lstrip and str.rstrip as suggested.

@kyo5uke
Copy link
Copy Markdown
Author

kyo5uke commented Jun 5, 2026

Thanks @picnixz! Applied the same inline phrasing to str.strip so all three (strip / lstrip / rstrip) now read "defaults to removing whitespace, that is characters for which str.isspace is true", and dropped the separate sentence.

@picnixz
Copy link
Copy Markdown
Member

picnixz commented Jun 5, 2026

Usually, one should ping maintainers after a while, say 1 month, if the first ping doesn't help. Maintainers have limited bandwidth and we can't reply the same day or the following.

@kyo5uke
Copy link
Copy Markdown
Author

kyo5uke commented Jun 5, 2026

Thanks for the review and the approval — really appreciate it. Understood about maintainer bandwidth; I'll be patient. Thanks again for taking the time.

@picnixz picnixz changed the title gh-69619: Define whitespace for str.lstrip() and str.rstrip() gh-69619: Clarify str.{l,r}strip() documentation Jun 5, 2026
@picnixz
Copy link
Copy Markdown
Member

picnixz commented Jun 5, 2026

@StanFromIreland You reviewed the orignal PR on str.strip(). Are you ok with my wording changes?

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

Labels

awaiting merge docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants