Skip to content

Commit 576e495

Browse files
encukouhukkin
authored andcommitted
Add What's New entry with the changes
1 parent 3ccb26f commit 576e495

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

Doc/library/tomllib.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
.. module:: tomllib
55
:synopsis: Parse TOML files.
66

7-
.. versionadded:: 3.11
8-
97
.. moduleauthor:: Taneli Hukkinen
108
.. sectionauthor:: Taneli Hukkinen
119

@@ -17,8 +15,12 @@ This module provides an interface for parsing TOML 1.1.0 (Tom's Obvious Minimal
1715
Language, `https://toml.io <https://toml.io/en/>`_). This module does not
1816
support writing TOML.
1917

18+
.. versionadded:: 3.11
19+
The module was added with support for TOML 1.0.0.
20+
2021
.. versionchanged:: next
21-
Module updated to support TOML 1.1.0. Initially the module supported TOML 1.0.0.
22+
Added TOML 1.1.0 support.
23+
See the :ref:`What's New <whatsnew315-tomllib-1-1-0>` for details.
2224

2325

2426
.. seealso::

Doc/whatsnew/3.15.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,55 @@ tkinter
798798
with outdated names.
799799
(Contributed by Serhiy Storchaka in :gh:`143754`)
800800

801+
802+
.. _whatsnew315-tomllib-1-1-0:
803+
804+
tomllib
805+
-------
806+
807+
* The :mod:`tomllib` module now supports TOML 1.1.0.
808+
This is a backwards compatible update, meaning that all valid TOML 1.0.0
809+
documents are parsed the same way.
810+
811+
The changes, according to the `official TOML changelog`_, are:
812+
813+
- Allow newlines and trailing commas in inline tables.
814+
815+
Previously an inline table had to be on a single line and couldn't end
816+
with a trailing comma. This is now relaxed so that the following is valid:
817+
818+
.. syntax highlighting needs TOML 1.1.1 support in Pygments,
819+
see https://github.com/pygments/pygments/issues/3026
820+
821+
.. code-block:: text
822+
823+
tbl = {
824+
key = "a string",
825+
moar-tbl = {
826+
key = 1,
827+
},
828+
}
829+
830+
- Add ``\xHH`` notation to basic strings for codepoints under 255,
831+
and the ``\e`` escape for the escape character:
832+
833+
.. code-block:: text
834+
835+
null = "null byte: \x00; letter a: \x61"
836+
csi = "\e["
837+
838+
- Seconds in datetime and time values are now optional.
839+
The following are now valid:
840+
841+
.. code-block:: text
842+
843+
dt = 2010-02-03 14:15
844+
t = 14:15
845+
846+
(Contributed by Taneli Hukkinen in :gh:`142956`.)
847+
848+
.. _official TOML changelog: https://github.com/toml-lang/toml/blob/main/CHANGELOG.md
849+
801850
types
802851
------
803852

0 commit comments

Comments
 (0)