From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:25:51 +0000 (+0100) Subject: [3.12] gh-114070: correct the specification of ``digit`` in the float() docs (GH... X-Git-Tag: v3.12.2~176 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f6315edca13f7879aab8ec181289e6f40e2b36ea;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-114070: correct the specification of ``digit`` in the float() docs (GH-114080) (#114094) gh-114070: correct the specification of ``digit`` in the float() docs (GH-114080) (cherry picked from commit 4f24b92aa0677ed5310dd2d1572b55f4e30c88ef) Co-authored-by: Sergey B Kirpichev --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 442cbdf1e6a7..b24680f9bc2a 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: + 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