@@ -2174,9 +2174,25 @@ expression support in the :mod:`re` module).
21742174 character, ``False `` otherwise. Digits include decimal characters and digits that need
21752175 special handling, such as the compatibility superscript digits.
21762176 This covers digits which cannot be used to form numbers in base 10,
2177- like the Kharosthi numbers. Formally, a digit is a character that has the
2177+ like the `Kharosthi numbers <https://en.wikipedia.org/wiki/Kharosthi#Numerals >`__.
2178+ Formally, a digit is a character that has the
21782179 property value Numeric_Type=Digit or Numeric_Type=Decimal.
21792180
2181+ For example:
2182+
2183+ .. doctest ::
2184+
2185+ >>> ' 0123456789' .isdigit()
2186+ True
2187+ >>> ' ٠١٢٣٤٥٦٧٨٩' .isdigit() # Arabic-Indic digits zero to nine
2188+ True
2189+ >>> ' ⅕' .isdigit() # Vulgar fraction one fifth
2190+ False
2191+ >>> ' ²' .isdecimal(), ' ²' .isdigit(), ' ²' .isnumeric()
2192+ (False, True, True)
2193+
2194+ See also :meth: `isdecimal ` and :meth: `isnumeric `.
2195+
21802196
21812197.. method :: str.isidentifier()
21822198
@@ -2217,15 +2233,14 @@ expression support in the :mod:`re` module).
22172233
22182234 >>> ' 0123456789' .isnumeric()
22192235 True
2220- >>> ' ٠١٢٣٤٥٦٧٨٩' .isnumeric() # Arabic-indic digit zero to nine
2236+ >>> ' ٠١٢٣٤٥٦٧٨٩' .isnumeric() # Arabic-Indic digits zero to nine
22212237 True
22222238 >>> ' ⅕' .isnumeric() # Vulgar fraction one fifth
22232239 True
22242240 >>> ' ²' .isdecimal(), ' ²' .isdigit(), ' ²' .isnumeric()
22252241 (False, True, True)
22262242
2227- See also :meth: `isdecimal ` and :meth: `isdigit `. Numeric characters are
2228- a superset of decimal numbers.
2243+ See also :meth: `isdecimal ` and :meth: `isdigit `.
22292244
22302245
22312246.. method :: str.isprintable()
@@ -2376,7 +2391,8 @@ expression support in the :mod:`re` module).
23762391
23772392 Return a copy of the string with leading characters removed. The *chars *
23782393 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 *
2394+ or ``None ``, the *chars * argument defaults to removing whitespace, that is
2395+ characters for which :meth: `str.isspace ` is true. The *chars *
23802396 argument is not a prefix; rather, all combinations of its values are stripped::
23812397
23822398 >>> ' spacious '.lstrip()
@@ -2579,7 +2595,8 @@ expression support in the :mod:`re` module).
25792595
25802596 Return a copy of the string with trailing characters removed. The *chars *
25812597 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 *
2598+ or ``None ``, the *chars * argument defaults to removing whitespace, that is
2599+ characters for which :meth: `str.isspace ` is true. The *chars *
25832600 argument is not a suffix; rather, all combinations of its values are stripped.
25842601 For example:
25852602
@@ -2755,11 +2772,9 @@ expression support in the :mod:`re` module).
27552772
27562773 Return a copy of the string with the leading and trailing characters removed.
27572774 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 `.
2775+ If omitted or ``None ``, the *chars * argument defaults to removing whitespace,
2776+ that is characters for which :meth: `str.isspace ` is true. The *chars * argument
2777+ is not a prefix or suffix; rather, all combinations of its values are stripped.
27632778
27642779 For example:
27652780
0 commit comments