diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-12-11 01:08:25 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-12-11 01:08:25 +0000 |
commit | 64dd02151dd046bcd7c590413ff7f688005bcb80 (patch) | |
tree | 062faded1ffbb3d6640d8ebe9ea6afe2080575a8 | |
parent | 5f9f43816321fad4e1e22e10a2f3ee360edc22ac (diff) | |
download | cpython-64dd02151dd046bcd7c590413ff7f688005bcb80.tar.gz |
Issue #26483: Clarify str.isdecimal() and isdigit()
Patch by Julien Palard.
-rw-r--r-- | Doc/library/stdtypes.rst | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 5690611bb7..e1d7149075 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1639,18 +1639,20 @@ expression support in the :mod:`re` module). Return true if all characters in the string are decimal characters and there is at least one character, false - otherwise. Decimal characters are those from general category "Nd". This category - includes digit characters, and all characters - that can be used to form decimal-radix numbers, e.g. U+0660, - ARABIC-INDIC DIGIT ZERO. + otherwise. Decimal characters are those that can be used to form + numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT + ZERO. Formally a decimal character is a character in the Unicode + General Category "Nd". .. method:: str.isdigit() Return true if all characters in the string are digits and there is at least one character, false otherwise. Digits include decimal characters and digits that need - special handling, such as the compatibility superscript digits. Formally, a digit - is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal. + special handling, such as the compatibility superscript digits. + This covers digits which cannot be used to form numbers in base 10, + like the Kharosthi numbers. Formally, a digit is a character that has the + property value Numeric_Type=Digit or Numeric_Type=Decimal. .. method:: str.isidentifier() |