There was an error while loading. Please reload this page.
1 parent d2ba756 commit e72ee65Copy full SHA for e72ee65
1 file changed
Doc/library/stdtypes.rst
@@ -2019,6 +2019,21 @@ expression support in the :mod:`re` module).
2019
that have the Unicode numeric value property, e.g. U+2155,
2020
VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property
2021
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
2030
+ >>> '⅕'.isnumeric() # Vulgar fraction one fifth
2031
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.
2037
2038
2039
.. method:: str.isprintable()
0 commit comments