Skip to content

gh-156414: Document tomllib's limits & "extensions" - #156415

Open
encukou wants to merge 1 commit into
python:mainfrom
encukou:toml-docs-clarification
Open

gh-156414: Document tomllib's limits & "extensions"#156415
encukou wants to merge 1 commit into
python:mainfrom
encukou:toml-docs-clarification

Conversation

@encukou

@encukou encukou commented Aug 26, 2026

Copy link
Copy Markdown
Member

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34240816 | 📁 Comparing e14d18b against main (f54fd2a)

  🔍 Preview build  

2 files changed
± library/fileformats.html
± library/tomllib.html

Comment thread Doc/library/tomllib.rst
Comment on lines +172 to +173
Key/value pairs in TOML documents and tables are not guaranteed to be
in any specific order.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be something like

Suggested change
Key/value pairs in TOML documents and tables are not guaranteed to be
in any specific order.
The TOML spec does not guarantee key/value pairs in TOML documents and
tables to be in any specific order.

As is I found it a bit unclear whether the unconditional mention of "Key/value pairs in TOML documents and tables" refers to the spec or the concrete impolementation.

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is okay, but I feel like it still is a little "well you can do this if you want to", when I think we should probably want to mildly discourage people relying on ordering of TOML tables (especially given TOML's stance on the matter toml-lang/toml#162)

Comment thread Doc/library/tomllib.rst
Comment on lines +166 to +167
When writing portable TOML files, consider only using features that are
guaranteed or recommended by the standard.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When writing portable TOML files, consider only using features that are
guaranteed or recommended by the standard.
When writing portable TOML files, only use features that are
guaranteed or recommended by the standard.

we shouldn't hedge, this is the only way to be portable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants