Skip to content

Commit 6ac4ebf

Browse files
[3.15] gh-106318: Improve str.lower() docs (GH-144848) (#163022)
gh-106318: Improve str.lower() docs (GH-144848) (cherry picked from commit f9704be) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent 1c06261 commit 6ac4ebf

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎Doc/builtins/stdtypes.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,6 +2676,19 @@ expression support in the :mod:`re` module).
26762676
>>> 'Lower Method Example'.lower()
26772677
'lower method example'
26782678

2679+
Note that ``s.lower().islower()`` might be ``False`` if ``s``
2680+
contains uncased characters or if the Unicode category of the resulting
2681+
character(s) is not "Lu" (Letter, uppercase), but for instance "Lt" (Letter,
2682+
titlecase).
2683+
2684+
For example, see the word "Python" written in Punjabi:
2685+
2686+
.. doctest::
2687+
2688+
>>> 'ازگر'.lower().islower()
2689+
False
2690+
2691+
26792692
The lowercasing algorithm used is `described in section 3.13.2 'Default Case
26802693
Conversion' of the Unicode Standard
26812694
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G34078>`__.

0 commit comments

Comments
 (0)