Skip to content

Commit 72f3637

Browse files
committed
Clarify tomllib docs
Closes gh-94584
1 parent 36fcde6 commit 72f3637

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Doc/library/tomllib.rst

+9-6
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ This module defines the following functions:
3636

3737
.. function:: load(fp, /, *, parse_float=float)
3838

39-
Read a TOML file. The first argument should be a readable and binary file object.
40-
Return a :class:`dict`. Convert TOML types to Python using this
41-
:ref:`conversion table <toml-to-py-table>`.
39+
Deserialize TOML data from a file-like object, converting TOML types to
40+
Python using this :ref:`conversion table <toml-to-py-table>`. The first
41+
argument should be a readable binary file-like object. Returns a
42+
:class:`dict`.
43+
4244

4345
*parse_float* will be called with the string of every TOML
4446
float to be decoded. By default, this is equivalent to ``float(num_str)``.
@@ -51,9 +53,10 @@ This module defines the following functions:
5153

5254
.. function:: loads(s, /, *, parse_float=float)
5355

54-
Load TOML from a :class:`str` object. Return a :class:`dict`. Convert TOML
55-
types to Python using this :ref:`conversion table <toml-to-py-table>`. The
56-
*parse_float* argument has the same meaning as in :func:`load`.
56+
Deserialize TOML data from a :class:`str` object, converting TOML types to
57+
Python using this :ref:`conversion table <toml-to-py-table>`. Returns a
58+
:class:`dict`. The *parse_float* argument has the same meaning as in
59+
:func:`load`.
5760

5861
A :exc:`TOMLDecodeError` will be raised on an invalid TOML document.
5962

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reword ``tomllib`` documentation for clarity

0 commit comments

Comments
 (0)