Skip to content

Commit 19b8f30

Browse files
committed
gh-69619: Define whitespace for str.lstrip() and str.rstrip()
1 parent 7a468a1 commit 19b8f30

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Doc/library/stdtypes.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2377,7 +2377,11 @@ expression support in the :mod:`re` module).
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
23792379
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
2380-
argument is not a prefix; rather, all combinations of its values are stripped::
2380+
argument is not a prefix; rather, all combinations of its values are stripped.
2381+
2382+
Whitespace characters are defined by :meth:`str.isspace`.
2383+
2384+
For example::
23812385

23822386
>>> ' spacious '.lstrip()
23832387
'spacious '
@@ -2581,6 +2585,9 @@ expression support in the :mod:`re` module).
25812585
argument is a string specifying the set of characters to be removed. If omitted
25822586
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
25832587
argument is not a suffix; rather, all combinations of its values are stripped.
2588+
2589+
Whitespace characters are defined by :meth:`str.isspace`.
2590+
25842591
For example:
25852592

25862593
.. doctest::

0 commit comments

Comments
 (0)