]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106318: Add examples for str.istitle() (#140046)
authorAdorilson Bezerra <adorilson@gmail.com>
Tue, 14 Oct 2025 14:19:27 +0000 (11:19 -0300)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 14:19:27 +0000 (17:19 +0300)
Doc/library/stdtypes.rst

index 21fe35edc1bef8489c31214175dae2d0916bd1b9..2c5b721093d5c0949785293d621cb414a8500646 100644 (file)
@@ -2157,6 +2157,19 @@ expression support in the :mod:`re` module).
    character, for example uppercase characters may only follow uncased characters
    and lowercase characters only cased ones.  Return ``False`` otherwise.
 
+   For example:
+
+   .. doctest::
+
+      >>> 'Spam, Spam, Spam'.istitle()
+      True
+      >>> 'spam, spam, spam'.istitle()
+      False
+      >>> 'SPAM, SPAM, SPAM'.istitle()
+      False
+
+   See also :meth:`title`.
+
 
 .. method:: str.isupper()
 
@@ -2534,6 +2547,8 @@ expression support in the :mod:`re` module).
         >>> titlecase("they're bill's friends.")
         "They're Bill's Friends."
 
+   See also :meth:`istitle`.
+
 
 .. method:: str.translate(table, /)