Skip to content

Commit 4084141

Browse files
kyo5ukepicnixz
andauthored
gh-69619: Clarify "whitespace" in the str.{l,r}strip() documentation (#150901)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 81965c1 commit 4084141

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Doc/library/stdtypes.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,8 @@ expression support in the :mod:`re` module).
23762376

23772377
Return a copy of the string with leading characters removed. The *chars*
23782378
argument is a string specifying the set of characters to be removed. If omitted
2379-
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
2379+
or ``None``, the *chars* argument defaults to removing whitespace, that is
2380+
characters for which :meth:`str.isspace` is true. The *chars*
23802381
argument is not a prefix; rather, all combinations of its values are stripped::
23812382

23822383
>>> ' spacious '.lstrip()
@@ -2579,7 +2580,8 @@ expression support in the :mod:`re` module).
25792580

25802581
Return a copy of the string with trailing characters removed. The *chars*
25812582
argument is a string specifying the set of characters to be removed. If omitted
2582-
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
2583+
or ``None``, the *chars* argument defaults to removing whitespace, that is
2584+
characters for which :meth:`str.isspace` is true. The *chars*
25832585
argument is not a suffix; rather, all combinations of its values are stripped.
25842586
For example:
25852587

@@ -2755,11 +2757,9 @@ expression support in the :mod:`re` module).
27552757

27562758
Return a copy of the string with the leading and trailing characters removed.
27572759
The *chars* argument is a string specifying the set of characters to be removed.
2758-
If omitted or ``None``, the *chars* argument defaults to removing whitespace.
2759-
The *chars* argument is not a prefix or suffix; rather, all combinations of its
2760-
values are stripped.
2761-
2762-
Whitespace characters are defined by :meth:`str.isspace`.
2760+
If omitted or ``None``, the *chars* argument defaults to removing whitespace,
2761+
that is characters for which :meth:`str.isspace` is true. The *chars* argument
2762+
is not a prefix or suffix; rather, all combinations of its values are stripped.
27632763

27642764
For example:
27652765

0 commit comments

Comments
 (0)