Kaydet (Commit) 49c14d8e authored tarafından Martin Panter's avatar Martin Panter

Issue #26483: Clarify str.isdecimal() and isdigit()

Patch by Julien Palard.
üst 41176ae1
...@@ -1639,18 +1639,20 @@ expression support in the :mod:`re` module). ...@@ -1639,18 +1639,20 @@ expression support in the :mod:`re` module).
Return true if all characters in the string are decimal Return true if all characters in the string are decimal
characters and there is at least one character, false characters and there is at least one character, false
otherwise. Decimal characters are those from general category "Nd". This category otherwise. Decimal characters are those that can be used to form
includes digit characters, and all characters numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT
that can be used to form decimal-radix numbers, e.g. U+0660, ZERO. Formally a decimal character is a character in the Unicode
ARABIC-INDIC DIGIT ZERO. General Category "Nd".
.. method:: str.isdigit() .. method:: str.isdigit()
Return true if all characters in the string are digits and there is at least one 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 character, false otherwise. Digits include decimal characters and digits that need
special handling, such as the compatibility superscript digits. Formally, a digit special handling, such as the compatibility superscript digits.
is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal. 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() .. method:: str.isidentifier()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment