We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3718f4b commit 33535e0Copy full SHA for 33535e0
1 file changed
Doc/library/stdtypes.rst
@@ -2264,6 +2264,22 @@ expression support in the :mod:`re` module).
2264
like the Kharosthi numbers. Formally, a digit is a character that has the
2265
property value Numeric_Type=Digit or Numeric_Type=Decimal.
2266
2267
+ For example:
2268
+
2269
+ .. doctest::
2270
2271
+ >>> '0123456789'.isdigit()
2272
+ True
2273
+ >>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-indic digits zero to nine
2274
2275
+ >>> '⅕'.isdigit() # Vulgar fraction one fifth
2276
+ False
2277
+ >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()
2278
+ (False, True, True)
2279
2280
+ See also :meth:`isdecimal` and :meth:`isnumeric`. Digital characters are a
2281
+ superset of decimal characters.
2282
2283
2284
.. method:: str.isidentifier()
2285
0 commit comments