Despite best efforts, in some cases the structure being represented can become somewhat nested. In such situations, the fact that TOML.printalways writes dicts out as [key.subkey...] thing=val can actually make the readability worse.
Here's a practical example from a file I have, processed we have:
I'd think a heuristic along the lines of "if number of key-value pairs less than (some N) and inline dict representation is <72 characters long, use an inline dict" could be quite helpful here.
( rewording of a comment in #40 )
Despite best efforts, in some cases the structure being represented can become somewhat nested. In such situations, the fact that
TOML.print
always writes dicts out as[key.subkey...] thing=val
can actually make the readability worse.Here's a practical example from a file I have, processed we have:
this becomes (via a parsing round-trip)
which I think is quite simply harder to read.
I'd think a heuristic along the lines of "if number of key-value pairs less than (some N) and inline dict representation is <72 characters long, use an inline dict" could be quite helpful here.