From a46fff4b82865dfb250a9a68c76e1fac60d7f477 Mon Sep 17 00:00:00 2001 From: Daniil Mayorov Date: Mon, 18 May 2026 22:12:13 +0300 Subject: [PATCH 1/3] gh-69619: Clarify whitespace definition in str.strip docs --- Doc/library/stdtypes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index e3bd1a46891adc..f84be886e27d54 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2747,6 +2747,8 @@ expression support in the :mod:`re` module). The *chars* argument is not a prefix or suffix; rather, all combinations of its values are stripped. + Whitespace characters are those defined by Unicode as spaces, tabs, and newline characters. + For example: .. doctest:: From 3f8c2118c2fdabac6b5144beacbab2ed9652aebb Mon Sep 17 00:00:00 2001 From: Daniil Mayorov Date: Mon, 18 May 2026 23:30:20 +0300 Subject: [PATCH 2/3] gh-69619: use str.isspace for whitespace definition --- 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 f84be886e27d54..12a4fad00244c6 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2747,8 +2747,8 @@ expression support in the :mod:`re` module). The *chars* argument is not a prefix or suffix; rather, all combinations of its values are stripped. - Whitespace characters are those defined by Unicode as spaces, tabs, and newline characters. - + Whitespace characters are defined by :meth:`str.isspace`. + For example: .. doctest:: From ace5bd12c97374b4a90cbd89755dda07c860ccf9 Mon Sep 17 00:00:00 2001 From: Daniil Mayorov Date: Mon, 18 May 2026 23:43:14 +0300 Subject: [PATCH 3/3] gh-69619: fix whitespace formatting --- 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 12a4fad00244c6..b0388c4e1f0bd4 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2748,7 +2748,7 @@ expression support in the :mod:`re` module). values are stripped. Whitespace characters are defined by :meth:`str.isspace`. - + For example: .. doctest::