@@ -650,20 +650,23 @@ are always available. They are listed here in alphabetical order.
650
650
sign may be ``'+' `` or ``'-' ``; a ``'+' `` sign has no effect on the value
651
651
produced. The argument may also be a string representing a NaN
652
652
(not-a-number), or positive or negative infinity. More precisely, the
653
- input must conform to the following grammar after leading and trailing
654
- whitespace characters are removed:
653
+ input must conform to the `` floatvalue `` production rule in the following
654
+ grammar, after leading and trailing whitespace characters are removed:
655
655
656
656
.. productionlist :: float
657
657
sign: "+" | "-"
658
658
infinity: "Infinity" | "inf"
659
659
nan: "nan"
660
- numeric_value: `floatnumber ` | `infinity ` | `nan `
661
- numeric_string: [`sign `] `numeric_value `
662
-
663
- Here ``floatnumber `` is the form of a Python floating-point literal,
664
- described in :ref: `floating `. Case is not significant, so, for example,
665
- "inf", "Inf", "INFINITY", and "iNfINity" are all acceptable spellings for
666
- positive infinity.
660
+ digitpart: `digit ` (["_"] `digit `)*
661
+ number: [`digitpart `] "." `digitpart ` | `digitpart ` ["."]
662
+ exponent: ("e" | "E") ["+" | "-"] `digitpart `
663
+ floatnumber: number [`exponent `]
664
+ floatvalue: [`sign `] (`floatnumber ` | `infinity ` | `nan `)
665
+
666
+ Here ``digit `` is a Unicode decimal digit (character in the Unicode general
667
+ category ``Nd ``). Case is not significant, so, for example, "inf", "Inf",
668
+ "INFINITY", and "iNfINity" are all acceptable spellings for positive
669
+ infinity.
667
670
668
671
Otherwise, if the argument is an integer or a floating point number, a
669
672
floating point number with the same value (within Python's floating point
0 commit comments