FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-106318: Add examples for str.casefold() and str.lower() methods by adorilson · Pull Request #142154 · python/cpython · GitHub

Repository navigation

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

Merged
vstinner merged 6 commits into
python:mainfrom
adorilson:106318.casefold_and_lower
Jan 7, 2026
Merged

vstinner merged 6 commits into
python:mainfrom
adorilson:106318.casefold_and_lower

Conversation

adorilson commented Dec 1, 2025 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor

WIP to #106318

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


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

Comment thread Doc/library/stdtypes.rst Outdated
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:

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What if we remove the sentence and put comments?

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

Comment thread Doc/library/stdtypes.rst Outdated
Co-authored-by: Victor Stinner <vstinner@python.org>
adorilson requested a review from vstinner January 6, 2026 21:17
Comment thread Doc/library/stdtypes.rst Outdated
Co-authored-by: Victor Stinner <vstinner@python.org>
adorilson requested a review from vstinner January 7, 2026 11:54

vstinner left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

StanFromIreland left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Comment thread Doc/library/stdtypes.rst
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
vstinner added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Jan 7, 2026
vstinner enabled auto-merge (squash) January 7, 2026 16:12
vstinner merged commit 51a56a3 into python:main Jan 7, 2026
32 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Jan 7, 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, 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 <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
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 <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

bedevere-app Bot commented Jan 7, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jan 7, 2026

bedevere-app Bot commented Jan 7, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.13 only 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 <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
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 <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

vstinner commented Jan 7, 2026

Copy link
Copy Markdown
Member

Merged, thanks!

thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
…ods (python#142154)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL