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 @@ -2155,6 +2155,21 @@ expression support in the :mod:`re` module).
21552155 that have the Unicode numeric value property, e.g. U+2155,
21562156 VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property
21572157 value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric.
2158+ For example:
2159+
2160+ .. doctest ::
2161+
2162+ >>> ' 0123456789' .isnumeric()
2163+ True
2164+ >>> ' ٠١٢٣٤٥٦٧��٩' .isnumeric() # Arabic-indic digit zero to nine
2165+ True
2166+ >>> ' ⅕' .isnumeric() # Vulgar fraction one fifth
2167+ True
2168+ >>> ' ²' .isdecimal(), ' ²' .isdigit(), ' ²' .isnumeric()
2169+ (False, True, True)
2170+
2171+ See also :meth: `isdecimal ` and :meth: `isdigit `. Numeric characters are
2172+ a superset of decimal numbers.
21582173
21592174
21602175.. method :: str.isprintable()
You can’t perform that action at this time.
0 commit comments