From 9884353492bdfe77e10a6d352355e7d9753c6a42 Mon Sep 17 00:00:00 2001 From: darida12321 <73121369+darida12321@users.noreply.github.com> Date: Sun, 12 Jul 2026 23:25:08 +0100 Subject: [PATCH 1/4] Add removeprefix() and removesuffix() to the str method summary. The "Text and Binary Sequence Type Methods Summary" section did not include the `removeprefix` and `removesuffix` functions, which were present later on in the "String Methods" section and the "Bytes and Bytearray Operations" section This is a small change that rectifies that. --- Doc/library/stdtypes.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 886648e820f071..285a61e92dc783 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1662,6 +1662,10 @@ category. | | :meth:`str.startswith` | :meth:`bytes.startswith` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.endswith` | :meth:`bytes.endswith` | +| +------------------+------------------------+--------------------+------------------------------+ +| | :meth:`str.removeprefix` | :meth:`bytes.removeprefix` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.removesuffix` | :meth:`bytes.removesuffix` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.count` | :meth:`bytes.count` | | +-------------------------------------------+---------------------------------------------------+ From 74b9381477156c060f5205b60606179c2a63753c Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 15 Jul 2026 19:38:09 +0200 Subject: [PATCH 2/4] Fix seperators --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 285a61e92dc783..ce31949da0e539 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1662,7 +1662,7 @@ category. | | :meth:`str.startswith` | :meth:`bytes.startswith` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.endswith` | :meth:`bytes.endswith` | -| +------------------+------------------------+--------------------+------------------------------+ +| +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.removeprefix` | :meth:`bytes.removeprefix` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.removesuffix` | :meth:`bytes.removesuffix` | From 77f2775a66b721f6b1037212d8910ea29977c411 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 15 Jul 2026 19:40:24 +0200 Subject: [PATCH 3/4] Move to 'Padding and Stripping' --- Doc/library/stdtypes.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index ce31949da0e539..816c712e7ada35 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1663,10 +1663,6 @@ category. | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.endswith` | :meth:`bytes.endswith` | | +-------------------------------------------+---------------------------------------------------+ -| | :meth:`str.removeprefix` | :meth:`bytes.removeprefix` | -| +-------------------------------------------+---------------------------------------------------+ -| | :meth:`str.removesuffix` | :meth:`bytes.removesuffix` | -| +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.count` | :meth:`bytes.count` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.replace` | :meth:`bytes.replace` | @@ -1724,6 +1720,10 @@ category. | | :meth:`str.strip` | :meth:`bytes.strip` | | +--------------------+----------------------+----------------------+----------------------------+ | | :meth:`str.lstrip` | :meth:`str.rstrip` | :meth:`bytes.lstrip` | :meth:`bytes.rstrip` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.removeprefix` | :meth:`bytes.removeprefix` | +| +-------------------------------------------+---------------------------------------------------+ +| | :meth:`str.removesuffix` | :meth:`bytes.removesuffix` | +--------------------------+--------------------+----------------------+----------------------+----------------------------+ | Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | | +-------------------------------------------+---------------------------------------------------+ From e0c9679bc11cb8da674a1f3e9f8f31acdbf0999c Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 15 Jul 2026 19:53:30 +0200 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Stan Ulbrych --- Doc/library/stdtypes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 816c712e7ada35..9df5eb78d286a5 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1720,11 +1720,11 @@ category. | | :meth:`str.strip` | :meth:`bytes.strip` | | +--------------------+----------------------+----------------------+----------------------------+ | | :meth:`str.lstrip` | :meth:`str.rstrip` | :meth:`bytes.lstrip` | :meth:`bytes.rstrip` | -| +-------------------------------------------+---------------------------------------------------+ +| +--------------------+----------------------+----------------------+----------------------------+ | | :meth:`str.removeprefix` | :meth:`bytes.removeprefix` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.removesuffix` | :meth:`bytes.removesuffix` | -+--------------------------+--------------------+----------------------+----------------------+----------------------------+ ++--------------------------+-------------------------------------------+---------------------------------------------------+ | Translation and Encoding | :meth:`str.translate` | :meth:`bytes.translate` | | +-------------------------------------------+---------------------------------------------------+ | | :meth:`str.maketrans` | :meth:`bytes.maketrans` |