diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-01-15 22:19:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 22:19:59 (GMT) |
commit | 4f24b92aa0677ed5310dd2d1572b55f4e30c88ef (patch) | |
tree | 0e1226704dd406b2e745df4776ced1657af28af6 | |
parent | d457345bbc6414db0443819290b04a9a4333313d (diff) | |
download | cpython-4f24b92aa0677ed5310dd2d1572b55f4e30c88ef.zip cpython-4f24b92aa0677ed5310dd2d1572b55f4e30c88ef.tar.gz cpython-4f24b92aa0677ed5310dd2d1572b55f4e30c88ef.tar.bz2 |
gh-114070: correct the specification of ``digit`` in the float() docs (#114080)
-rw-r--r-- | Doc/library/functions.rst | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 4682ec9..37234f7 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -668,16 +668,15 @@ are always available. They are listed here in alphabetical order. sign: "+" | "-" infinity: "Infinity" | "inf" nan: "nan" - digitpart: `!digit` (["_"] `!digit`)* + digit: <a Unicode decimal digit, i.e. characters in Unicode general category Nd> + digitpart: `digit` (["_"] `digit`)* number: [`digitpart`] "." `digitpart` | `digitpart` ["."] exponent: ("e" | "E") ["+" | "-"] `digitpart` floatnumber: number [`exponent`] floatvalue: [`sign`] (`floatnumber` | `infinity` | `nan`) - Here ``digit`` is a Unicode decimal digit (character in the Unicode general - category ``Nd``). Case is not significant, so, for example, "inf", "Inf", - "INFINITY", and "iNfINity" are all acceptable spellings for positive - infinity. + Case is not significant, so, for example, "inf", "Inf", "INFINITY", and + "iNfINity" are all acceptable spellings for positive infinity. Otherwise, if the argument is an integer or a floating point number, a floating point number with the same value (within Python's floating point |