Skip to content

Commit 4f24b92

Browse files
authored
gh-114070: correct the specification of digit in the float() docs (#114080)
1 parent d457345 commit 4f24b92

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Doc/library/functions.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,16 +668,15 @@ are always available. They are listed here in alphabetical order.
668668
sign: "+" | "-"
669669
infinity: "Infinity" | "inf"
670670
nan: "nan"
671-
digitpart: `!digit` (["_"] `!digit`)*
671+
digit: <a Unicode decimal digit, i.e. characters in Unicode general category Nd>
672+
digitpart: `digit` (["_"] `digit`)*
672673
number: [`digitpart`] "." `digitpart` | `digitpart` ["."]
673674
exponent: ("e" | "E") ["+" | "-"] `digitpart`
674675
floatnumber: number [`exponent`]
675676
floatvalue: [`sign`] (`floatnumber` | `infinity` | `nan`)
676677

677-
Here ``digit`` is a Unicode decimal digit (character in the Unicode general
678-
category ``Nd``). Case is not significant, so, for example, "inf", "Inf",
679-
"INFINITY", and "iNfINity" are all acceptable spellings for positive
680-
infinity.
678+
Case is not significant, so, for example, "inf", "Inf", "INFINITY", and
679+
"iNfINity" are all acceptable spellings for positive infinity.
681680

682681
Otherwise, if the argument is an integer or a floating point number, a
683682
floating point number with the same value (within Python's floating point

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy