File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2019,6 +2019,21 @@ expression support in the :mod:`re` module).
20192019 that have the Unicode numeric value property, e.g. U+2155,
20202020 VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property
20212021 value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric.
2022+ For example:
2023+
2024+ .. doctest ::
2025+
2026+ >>> ' 0123456789' .isnumeric()
2027+ True
2028+ >>> ' ٠١٢٣٤٥٦٧٨٩' .isnumeric() # Arabic-indic digit zero to nine
2029+ True
2030+ >>> ' ⅕' .isnumeric() # Vulgar fraction one fifth
2031+ True
2032+ >>> ' ²' .isdecimal(), ' ²' .isdigit(), ' ²' .isnumeric()
2033+ (False, True, True)
2034+
2035+ See also :meth: `isdecimal ` and :meth: `isdigit `. Numeric characters are
2036+ a superset of decimal numbers.
20222037
20232038
20242039.. method :: str.isprintable()
You can’t perform that action at this time.
0 commit comments