Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49c14d8

Browse files
committed
Issue #26483: Clarify str.isdecimal() and isdigit()
Patch by Julien Palard.
1 parent 41176ae commit 49c14d8

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Doc/library/stdtypes.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,18 +1639,20 @@ expression support in the :mod:`re` module).
16391639

16401640
Return true if all characters in the string are decimal
16411641
characters and there is at least one character, false
1642-
otherwise. Decimal characters are those from general category "Nd". This category
1643-
includes digit characters, and all characters
1644-
that can be used to form decimal-radix numbers, e.g. U+0660,
1645-
ARABIC-INDIC DIGIT ZERO.
1642+
otherwise. Decimal characters are those that can be used to form
1643+
numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT
1644+
ZERO. Formally a decimal character is a character in the Unicode
1645+
General Category "Nd".
16461646

16471647

16481648
.. method:: str.isdigit()
16491649

16501650
Return true if all characters in the string are digits and there is at least one
16511651
character, false otherwise. Digits include decimal characters and digits that need
1652-
special handling, such as the compatibility superscript digits. Formally, a digit
1653-
is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal.
1652+
special handling, such as the compatibility superscript digits.
1653+
This covers digits which cannot be used to form numbers in base 10,
1654+
like the Kharosthi numbers. Formally, a digit is a character that has the
1655+
property value Numeric_Type=Digit or Numeric_Type=Decimal.
16541656

16551657

16561658
.. method:: str.isidentifier()

0 commit comments

Comments
 (0)