File tree Expand file tree Collapse file tree 2 files changed +54
-3
lines changed
Expand file tree Collapse file tree 2 files changed +54
-3
lines changed Original file line number Diff line number Diff line change 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
1715Language, `https://toml.io <https://toml.io/en/ >`_). This module does not
1816support 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 ::
Original file line number Diff line number Diff 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+
801850types
802851------
803852
You can’t perform that action at this time.
0 commit comments