]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-106318: Add examples for str.istitle() (GH-140046) (#140114)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 14 Oct 2025 14:25:57 +0000 (16:25 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 14:25:57 +0000 (14:25 +0000)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Doc/library/stdtypes.rst

index 45cec1027c104ea96f9c790dff3b7f10fe970ec7..35791ffd8b08aa659130bd8f4227ba384c864330 100644 (file)
@@ -2021,6 +2021,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()
 
@@ -2398,6 +2411,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, /)