Skip to content

Commit 3eb32bd

Browse files
committed
gh-106318: Add doctest role and 'See also' for str.removesuffix()
1 parent 37cef7e commit 3eb32bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,9 @@ expression support in the :mod:`re` module).
23872387

23882388
If the string ends with the *suffix* string and that *suffix* is not empty,
23892389
return ``string[:-len(suffix)]``. Otherwise, return a copy of the
2390-
original string::
2390+
original string:
2391+
2392+
.. doctest::
23912393

23922394
>>> 'MiscTests'.removesuffix('Tests')
23932395
'Misc'
@@ -2396,6 +2398,8 @@ expression support in the :mod:`re` module).
23962398

23972399
.. versionadded:: 3.9
23982400

2401+
See also :meth:`removeprefix` and :meth:`endswith`.
2402+
23992403

24002404
.. method:: str.replace(old, new, /, count=-1)
24012405

0 commit comments

Comments
 (0)