https://github.com/python/cpython/commit/1de1d3d6d7f57403e32db0bbbab32976a6f8bf86
commit: 1de1d3d6d7f57403e32db0bbbab32976a6f8bf86
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-01-07T18:03:24+01:00
summary:

[3.13] gh-106318: Add examples for str.casefold() and str.lower() methods 
(GH-142154) (#143525)

gh-106318: Add examples for str.casefold() and str.lower() methods (GH-142154)
(cherry picked from commit 51a56a3a7bd8cf05ceda65e843fb7bae40509799)

Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Doc/library/stdtypes.rst

diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index c8cbf642ea6364..3efe8ede5cc83f 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1706,6 +1706,14 @@ expression support in the :mod:`re` module).
    lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already
    lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold`
    converts it to ``"ss"``.
+   For example:
+
+   .. doctest::
+
+      >>> 'straße'.lower()
+      'straße'
+      >>> 'straße'.casefold()
+      'strasse'
 
    The casefolding algorithm is
    `described in section 3.13 'Default Case Folding' of the Unicode Standard
@@ -2162,7 +2170,12 @@ expression support in the :mod:`re` module).
 .. method:: str.lower()
 
    Return a copy of the string with all the cased characters [4]_ converted to
-   lowercase.
+   lowercase. For example:
+
+   .. doctest::
+
+      >>> 'Lower Method Example'.lower()
+      'lower method example'
 
    The lowercasing algorithm used is
    `described in section 3.13 'Default Case Folding' of the Unicode Standard

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to