https://github.com/python/cpython/commit/4084141073127669a7790572d43e9395e1f0d977
commit: 4084141073127669a7790572d43e9395e1f0d977
branch: main
author: きょうすけ <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-06-07T19:25:50+01:00
summary:
gh-69619: Clarify "whitespace" in the `str.{l,r}strip()` documentation (#150901)
Co-authored-by: Bénédikt Tran <[email protected]>
files:
M Doc/library/stdtypes.rst
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index f770809dfb4006..693bb199cbec69 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2376,7 +2376,8 @@ expression support in the :mod:`re` module).
Return a copy of the string with leading characters removed. The *chars*
argument is a string specifying the set of characters to be removed. If
omitted
- or ``None``, the *chars* argument defaults to removing whitespace. The
*chars*
+ or ``None``, the *chars* argument defaults to removing whitespace, that is
+ characters for which :meth:`str.isspace` is true. The *chars*
argument is not a prefix; rather, all combinations of its values are
stripped::
>>> ' spacious '.lstrip()
@@ -2579,7 +2580,8 @@ expression support in the :mod:`re` module).
Return a copy of the string with trailing characters removed. The *chars*
argument is a string specifying the set of characters to be removed. If
omitted
- or ``None``, the *chars* argument defaults to removing whitespace. The
*chars*
+ or ``None``, the *chars* argument defaults to removing whitespace, that is
+ characters for which :meth:`str.isspace` is true. The *chars*
argument is not a suffix; rather, all combinations of its values are
stripped.
For example:
@@ -2755,11 +2757,9 @@ expression support in the :mod:`re` module).
Return a copy of the string with the leading and trailing characters
removed.
The *chars* argument is a string specifying the set of characters to be
removed.
- If omitted or ``None``, the *chars* argument defaults to removing
whitespace.
- The *chars* argument is not a prefix or suffix; rather, all combinations of
its
- values are stripped.
-
- Whitespace characters are defined by :meth:`str.isspace`.
+ If omitted or ``None``, the *chars* argument defaults to removing
whitespace,
+ that is characters for which :meth:`str.isspace` is true. The *chars*
argument
+ is not a prefix or suffix; rather, all combinations of its values are
stripped.
For example:
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]