Skip to content

Commit 5c7733a

Browse files
committed
gh-106318: Improve str.lower() docs
1 parent 23c488d commit 5c7733a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,6 +2437,20 @@ expression support in the :mod:`re` module).
24372437
>>> 'Lower Method Example'.lower()
24382438
'lower method example'
24392439

2440+
Note that ``s.lower().islower()`` might be ``False`` if ``s``
2441+
contains uncased characters or if the Unicode category of the resulting
2442+
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
2443+
titlecase).
2444+
2445+
For example, see the word "Python" written in Punjabi, the most spoken
2446+
language in Pakistan:
2447+
2448+
.. doctest::
2449+
2450+
>>> 'ازگر'.lower().islower()
2451+
False
2452+
2453+
24402454
The lowercasing algorithm used is `described in section 3.13.2 'Default Case
24412455
Conversion' of the Unicode Standard
24422456
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G34078>`__.

0 commit comments

Comments
 (0)