gh-106318: Add examples for str.casefold() and str.lower() methods#142154
Merged
vstinner merged 6 commits intopython:mainfrom Jan 7, 2026
Merged
gh-106318: Add examples for str.casefold() and str.lower() methods#142154vstinner merged 6 commits intopython:mainfrom
vstinner merged 6 commits intopython:mainfrom
Conversation
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: |
Member
There was a problem hiding this comment.
I find this is a little repetitive, if one reads the sentence the example just repeats the exact same thing.
Contributor
Author
There was a problem hiding this comment.
What if we remove the sentence and put comments?
>>> 'ß'.casefold() # the German lowercase letter ``'ß'``
'ss'
>>> 'ß'.lower() # since it is already lowercase, lower does nothing
'ß'
vstinner
reviewed
Jan 6, 2026
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner
reviewed
Jan 7, 2026
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
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>
|
GH-143524 is a backport of this pull request to the 3.14 branch. |
|
GH-143525 is a backport of this pull request to the 3.13 branch. |
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>
Member
|
Merged, thanks! |
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
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.
WIP to #106318
gh-106318: Add examples for str.casefold() and str.lower() methods
📚 Documentation preview 📚: https://cpython-previews--142154.org.readthedocs.build/