https://github.com/python/cpython/commit/07e617ecc274f21607320e68a7e8b09ee91f968b
commit: 07e617ecc274f21607320e68a7e8b09ee91f968b
branch: main
author: Adorilson Bezerra <[email protected]>
committer: hugovk <[email protected]>
date: 2025-10-14T17:19:27+03:00
summary:
gh-106318: Add examples for str.istitle() (#140046)
files:
M Doc/library/stdtypes.rst
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 21fe35edc1bef8..2c5b721093d5c0 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -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, /)
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]