Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Clarify tomllib docs
Closes gh-94584
  • Loading branch information
kj7rrv committed Jul 5, 2022
commit 72f363794d7e577b86144a46cb84c1bfa539b95f
15 changes: 9 additions & 6 deletions Doc/library/tomllib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <toml-to-py-table>`.
Deserialize TOML data from a file-like object, converting TOML types to
Python using this :ref:`conversion table <toml-to-py-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)``.
Expand All @@ -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 <toml-to-py-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 <toml-to-py-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.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reword ``tomllib`` documentation for clarity