There was an error while loading. Please reload this page.
1 parent 78dd2d5 commit e0243c6Copy full SHA for e0243c6
1 file changed
Doc/library/stdtypes.rst
@@ -2155,6 +2155,21 @@ expression support in the :mod:`re` module).
2155
that have the Unicode numeric value property, e.g. U+2155,
2156
VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property
2157
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
2166
+ >>> '⅕'.isnumeric() # Vulgar fraction one fifth
2167
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.
2173
2174
2175
.. method:: str.isprintable()
0 commit comments