Skip to content

Commit f9704be

Browse files
authored
gh-106318: Improve str.lower() docs (GH-144848)
1 parent 762b8ec commit f9704be

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

2699+
Note that ``s.lower().islower()`` might be ``False`` if ``s``
2700+
contains uncased characters or if the Unicode category of the resulting
2701+
character(s) is not "Lu" (Letter, uppercase), but for instance "Lt" (Letter,
2702+
titlecase).
2703+
2704+
For example, see the word "Python" written in Punjabi:
2705+
2706+
.. doctest::
2707+
2708+
>>> 'ازگر'.lower().islower()
2709+
False
2710+
2711+
26992712
The lowercasing algorithm used is `described in section 3.13.2 'Default Case
27002713
Conversion' of the Unicode Standard
27012714
<https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-3/#G34078>`__.

0 commit comments

Comments
 (0)