Skip to content

Commit 25ab03f

Browse files
committed
Revert "gh-106318: Remove str.removesuffix() example from str.rsplit() method doc"
This reverts commit 9fa3ecc. As asked by @nedbat on gh-143893
1 parent 3e78e07 commit 25ab03f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Doc/library/stdtypes.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,13 @@ expression support in the :mod:`re` module).
26162616
>>> 'mississippi'.rstrip('ipz')
26172617
'mississ'
26182618

2619-
See also :meth:`strip` and :meth:`removesuffix`.
2619+
See :meth:`str.removesuffix` for a method that will remove a single suffix
2620+
string rather than all of a set of characters. For example::
2621+
2622+
>>> 'Monty Python'.rstrip(' Python')
2623+
'M'
2624+
>>> 'Monty Python'.removesuffix(' Python')
2625+
'Monty'
26202626

26212627

26222628
.. method:: str.split(sep=None, maxsplit=-1)

0 commit comments

Comments
 (0)