Uh oh!
There was an error while loading. Please reload this page.
gh-106318: Add examples for str.casefold() and str.lower() methods - #142154
Conversation
| 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: |
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.
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'ß'Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Thanks @adorilson for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…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>
…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. |
…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>
…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
Merged, thanks! |
…ods (python#142154) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
WIP to #106318
gh-106318: Add examples for str.casefold() and str.lower() methods
📚 Documentation preview 📚: https://cpython-previews--142154.org.readthedocs.build/