From 5ff748493eeb0aa739813ab2e51ca059564c6d48 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Wed, 26 Jan 2022 21:51:38 +0200 Subject: [PATCH 1/2] PEP 680: Note that double precision float is a recommendation not requirement --- pep-0680.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pep-0680.rst b/pep-0680.rst index 749e4d355b0..1acf35c16af 100644 --- a/pep-0680.rst +++ b/pep-0680.rst @@ -332,14 +332,17 @@ support could be added later in a backward-compatible way. Removing support for ``parse_float`` in ``tomllib.load[s]`` ----------------------------------------------------------- -This option is not strictly necessary, since TOML floats are "IEEE 754 binary64 -values", which is equivalent to a Python ``float`` on most architectures. -However, parsing floats differently, such as to ``decimal.Decimal``, allows -users extra precision beyond that promised by the TOML format. In the -author of ``tomli``'s experience, this is particularly useful in scientific and -financial applications. This is also useful for other cases that need greater -precision, or where end-users include non-developers who may not be aware of -the limits of binary64 floats. +This option is not strictly necessary, since TOML floats should be implemented +as "IEEE 754 binary64 values", which is equivalent to a Python ``float`` on most +architectures. + +The TOML specification uses the words "SHOULD", however, implying a +recommendation that can be ignored for valid reasons. Parsing floats +differently, such as to ``decimal.Decimal``, allows users extra precision beyond +that promised by the TOML format. In the author of ``tomli``'s experience, this +is particularly useful in scientific and financial applications. This is also +useful for other cases that need greater precision, or where end-users include +non-developers who may not be aware of the limits of binary64 floats. There are also niche architectures where the Python ``float`` is not a IEEE 754 binary64 value. The ``parse_float`` argument allows users to achieve correct From 4bed998e282671b42fa926e083b2128d92310ed6 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Wed, 26 Jan 2022 22:04:09 +0200 Subject: [PATCH 2/2] Remove "s" --- pep-0680.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pep-0680.rst b/pep-0680.rst index 1acf35c16af..44ba788088a 100644 --- a/pep-0680.rst +++ b/pep-0680.rst @@ -336,7 +336,7 @@ This option is not strictly necessary, since TOML floats should be implemented as "IEEE 754 binary64 values", which is equivalent to a Python ``float`` on most architectures. -The TOML specification uses the words "SHOULD", however, implying a +The TOML specification uses the word "SHOULD", however, implying a recommendation that can be ignored for valid reasons. Parsing floats differently, such as to ``decimal.Decimal``, allows users extra precision beyond that promised by the TOML format. In the author of ``tomli``'s experience, this