summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-01-15 22:26:40 (GMT)
committerGitHub <noreply@github.com>2024-01-15 22:26:40 (GMT)
commit76433f8c45e978f48d642e070025b6e4e7207857 (patch)
tree4a9d99cb17bc41eec61ad0bbad3dd1ef70b05ca3
parent3a181a10b1295d26d6a2a66643c365f460d5e4d5 (diff)
downloadcpython-76433f8c45e978f48d642e070025b6e4e7207857.zip
cpython-76433f8c45e978f48d642e070025b6e4e7207857.tar.gz
cpython-76433f8c45e978f48d642e070025b6e4e7207857.tar.bz2
[3.11] gh-114070: correct the specification of ``digit`` in the float() docs (GH-114080) (#114095)
gh-114070: correct the specification of ``digit`` in the float() docs (GH-114080) (cherry picked from commit 4f24b92aa0677ed5310dd2d1572b55f4e30c88ef) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
-rw-r--r--Doc/library/functions.rst9
1 files changed, 4 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 22e46be..a41a4d2 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -667,16 +667,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