Skip to content

Commit 5830105

Browse files
authored
gh-106318: Add doctest role for str.capitalize() examples
1 parent 7e9fff6 commit 5830105

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/library/stdtypes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,9 @@ expression support in the :mod:`re` module).
17591759
.. method:: str.capitalize()
17601760

17611761
Return a copy of the string with its first character capitalized and the
1762-
rest lowercased. For example::
1762+
rest lowercased. For example:
1763+
1764+
.. doctest::
17631765

17641766
>>> 'PYTHON IS AMAZING'.capitalize()
17651767
'Python is amazing'
@@ -1773,6 +1775,7 @@ expression support in the :mod:`re` module).
17731775
This means that characters like digraphs will only have their first
17741776
letter capitalized, instead of the full character.
17751777

1778+
17761779
.. method:: str.casefold()
17771780

17781781
Return a casefolded copy of the string. Casefolded strings may be used for

0 commit comments

Comments
 (0)