Skip to content

gh-69619: Clarify whitespace definition in str.strip docs#150021

Merged
encukou merged 3 commits into
python:mainfrom
Daniil20xx:ospath
May 19, 2026
Merged

gh-69619: Clarify whitespace definition in str.strip docs#150021
encukou merged 3 commits into
python:mainfrom
Daniil20xx:ospath

Conversation

@Daniil20xx
Copy link
Copy Markdown
Contributor

@Daniil20xx Daniil20xx commented May 18, 2026

Clarify that whitespace characters in str.strip are defined by Unicode,
including spaces, tabs, and newline characters.

@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels May 18, 2026
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 18, 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 May 18, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32745644 | 📁 Comparing ace5bd1 against main (6d5be4b)

  🔍 Preview build  

2 files changed
± library/stdtypes.html
± whatsnew/changelog.html

Comment thread Doc/library/stdtypes.rst Outdated
The *chars* argument is not a prefix or suffix; rather, all combinations of its
values are stripped.

Whitespace characters are those defined by Unicode as spaces, tabs, and newline characters.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is inaccurate, the UCD defines properties, not such categories. For example, the file separator is not covered by your sentence:

>>> '\x1c'.isspace()
True
>>> '\x1c'.strip()
''

I think it would be simpler to link to str.isspace(), which already lists all the properties precisely.

@encukou encukou merged commit 17eb17d into python:main May 19, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs May 19, 2026
@encukou encukou added awaiting review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels May 19, 2026
@miss-islington-app
Copy link
Copy Markdown

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

@miss-islington-app
Copy link
Copy Markdown

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

@miss-islington-app
Copy link
Copy Markdown

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

@encukou
Copy link
Copy Markdown
Member

encukou commented May 19, 2026

Thank you!

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 19, 2026

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label May 19, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 19, 2026

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 19, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 19, 2026

GH-150049 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants