Skip to content

Commit f477d9a

Browse files
hugovkadorilson
andauthored
[3.14] gh-106318: Improve str.lower() docs (GH-144848) (#163078)
(cherry picked from commit f9704be) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent b970bcd commit f477d9a

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
@@ -2421,6 +2421,19 @@ expression support in the :mod:`re` module).
24212421
>>> 'Lower Method Example'.lower()
24222422
'lower method example'
24232423

2424+
Note that ``s.lower().islower()`` might be ``False`` if ``s``
2425+
contains uncased characters or if the Unicode category of the resulting
2426+
character(s) is not "Lu" (Letter, uppercase), but for instance "Lt" (Letter,
2427+
titlecase).
2428+
2429+
For example, see the word "Python" written in Punjabi:
2430+
2431+
.. doctest::
2432+
2433+
>>> 'ازگر'.lower().islower()
2434+
False
2435+
2436+
24242437
The lowercasing algorithm used is
24252438
`described in section 3.13 'Default Case Folding' of the Unicode Standard
24262439
<https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G33992>`__.

0 commit comments

Comments
 (0)