Skip to content

Commit 1b401b4

Browse files
committed
gh-106318: Add doctest role to str.rsplit() method
1 parent c461aa9 commit 1b401b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2577,7 +2577,11 @@ expression support in the :mod:`re` module).
25772577
Return a copy of the string with trailing characters removed. The *chars*
25782578
argument is a string specifying the set of characters to be removed. If omitted
25792579
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
2580-
argument is not a suffix; rather, all combinations of its values are stripped::
2580+
argument is not a suffix; rather, all combinations of its values are stripped:
2581+
2582+
For example:
2583+
2584+
.. doctest::
25812585

25822586
>>> ' spacious '.rstrip()
25832587
' spacious'
@@ -2592,6 +2596,7 @@ expression support in the :mod:`re` module).
25922596
>>> 'Monty Python'.removesuffix(' Python')
25932597
'Monty'
25942598

2599+
25952600
.. method:: str.split(sep=None, maxsplit=-1)
25962601

25972602
Return a list of the words in the string, using *sep* as the delimiter

0 commit comments

Comments
 (0)