From 72f363794d7e577b86144a46cb84c1bfa539b95f Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 5 Jul 2022 13:14:21 -0700 Subject: [PATCH 1/3] Clarify `tomllib` docs Closes gh-94584 --- Doc/library/tomllib.rst | 15 +++++++++------ .../2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst diff --git a/Doc/library/tomllib.rst b/Doc/library/tomllib.rst index 918576eb37eaee..54d6d4baca387c 100644 --- a/Doc/library/tomllib.rst +++ b/Doc/library/tomllib.rst @@ -36,9 +36,11 @@ This module defines the following functions: .. function:: load(fp, /, *, parse_float=float) - Read a TOML file. The first argument should be a readable and binary file object. - Return a :class:`dict`. Convert TOML types to Python using this - :ref:`conversion table `. + Deserialize TOML data from a file-like object, converting TOML types to + Python using this :ref:`conversion table `. The first + argument should be a readable binary file-like object. Returns a + :class:`dict`. + *parse_float* will be called with the string of every TOML float to be decoded. By default, this is equivalent to ``float(num_str)``. @@ -51,9 +53,10 @@ This module defines the following functions: .. function:: loads(s, /, *, parse_float=float) - Load TOML from a :class:`str` object. Return a :class:`dict`. Convert TOML - types to Python using this :ref:`conversion table `. The - *parse_float* argument has the same meaning as in :func:`load`. + Deserialize TOML data from a :class:`str` object, converting TOML types to + Python using this :ref:`conversion table `. Returns a + :class:`dict`. The *parse_float* argument has the same meaning as in + :func:`load`. A :exc:`TOMLDecodeError` will be raised on an invalid TOML document. diff --git a/Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst b/Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst new file mode 100644 index 00000000000000..4dbe6a092a7a90 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst @@ -0,0 +1 @@ +Reword ``tomllib`` documentation for clarity From e429208a905ba6d075a7fd56ba0736adab32aec5 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 5 Jul 2022 13:24:38 -0700 Subject: [PATCH 2/3] Remove extra whitespace --- Doc/library/tomllib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/tomllib.rst b/Doc/library/tomllib.rst index 54d6d4baca387c..f0bade0cc25561 100644 --- a/Doc/library/tomllib.rst +++ b/Doc/library/tomllib.rst @@ -40,7 +40,7 @@ This module defines the following functions: Python using this :ref:`conversion table `. The first argument should be a readable binary file-like object. Returns a :class:`dict`. - + *parse_float* will be called with the string of every TOML float to be decoded. By default, this is equivalent to ``float(num_str)``. From 397106762adac9f9f8fd449a280bc893071977fe Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Wed, 6 Jul 2022 10:19:14 -0700 Subject: [PATCH 3/3] Remove NEWS entry --- .../Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst diff --git a/Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst b/Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst deleted file mode 100644 index 4dbe6a092a7a90..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2022-07-05-13-13-28.gh-issue-94584.Ll5tXG.rst +++ /dev/null @@ -1 +0,0 @@ -Reword ``tomllib`` documentation for clarity