Skip to content

Conversation

@adorilson
Copy link
Contributor

@adorilsonadorilson commented Dec 1, 2025

WIP to #106318

gh-106318: Add examples for str.casefold() and str.lower() methods


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

lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already
lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold`
converts it to ``"ss"``.
converts it to ``"ss"``, as follows:

Choose a reason for hiding this comment

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

I find this is a little repetitive, if one reads the sentence the example just repeats the exact same thing.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

What if we remove the sentence and put comments?

>>>'ß'.casefold() # the German lowercase letter ``'ß'``'ss'>>>'ß'.lower() # since it is already lowercase, lower does nothing'ß'

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@StanFromIrelandStanFromIreland left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinnervstinner added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jan 7, 2026
@vstinnervstinner enabled auto-merge (squash) January 7, 2026 16:12
@vstinnervstinner merged commit 51a56a3 into python:mainJan 7, 2026
32 checks passed
@github-project-automationgithub-project-automationbot moved this from Todo to Done in Docs PRsJan 7, 2026
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 7, 2026
…ods (pythonGH-142154) (cherry picked from commit 51a56a3) 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 Jan 7, 2026
…ods (pythonGH-142154) (cherry picked from commit 51a56a3) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.14 bugs and security fixes label Jan 7, 2026
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Jan 7, 2026
vstinner added a commit that referenced this pull request Jan 7, 2026
…hods (GH-142154) (#143524) gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154) (cherry picked from commit 51a56a3) 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 Jan 7, 2026
…hods (GH-142154) (#143525) gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154) (cherry picked from commit 51a56a3) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
@vstinner
Copy link
Member

Merged, thanks!

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

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

@adorilson@vstinner@StanFromIreland