From fc648b3ea8cb0723375a6fda1ae2d1d6e6a22575 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Wed, 2 Dec 2026 12:19:25 -0300 Subject: [PATCH] gh-106318: Add examples for str.islower() docs (GH-144847) (cherry picked from commit dd3f5cdc092844e079ccf21e65703a2b684678cc) Co-authored-by: Adorilson Bezerra --- Doc/builtins/stdtypes.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Doc/builtins/stdtypes.rst b/Doc/builtins/stdtypes.rst index d956ec7c5627b0d..db5c4316b6946f4 100644 --- a/Doc/builtins/stdtypes.rst +++ b/Doc/builtins/stdtypes.rst @@ -2237,6 +2237,23 @@ expression support in the :mod:`re` module). Return ``True`` if all cased characters [4]_ in the string are lowercase and there is at least one cased character, ``False`` otherwise. + For example: + + .. doctest:: + + >>> 'banana'.islower() + True + >>> 'BANANA'.islower() + False + >>> 'baNana'.islower() + False + >>> ' '.islower() + False + >>> ''.islower() + False + + See also :meth:`isupper` and :meth:`lower`. + .. method:: str.isnumeric() @@ -2349,7 +2366,10 @@ expression support in the :mod:`re` module). False >>> ' '.isupper() False + >>> ''.isupper() + False + See also :meth:`islower` and :meth:`upper`. .. _meth-str-join: