File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2264,6 +2264,22 @@ expression support in the :mod:`re` module).
22642264 like the Kharosthi numbers. Formally, a digit is a character that has the
22652265 property value Numeric_Type=Digit or Numeric_Type=Decimal.
22662266
2267+ For example:
2268+
2269+ .. doctest ::
2270+
2271+ >>> ' 0123456789' .isdigit()
2272+ True
2273+ >>> ' ٠١٢٣٤٥٦٧٨٩' .isdigit() # Arabic-indic digits zero to nine
2274+ True
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+
22672283
22682284.. method :: str.isidentifier()
22692285
You can’t perform that action at this time.
0 commit comments