You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[my_data]
inline_value = 'this is a scalar'inline_table = { this = 'generates', an = 10, 'inline table' = true }
[my_data.separate_table]
this = 'creates''another table' = 42
The current implementation of TOMLEncoder.dump_sections()always rendersdict as regular tables even if a dumper is assigned to TOMLEncoder.st. Since collections.UserDict is not a subclass ofdict, it circumvents this issue.
I know this is fragile and unreliable. However, since qtoml doesn't expose a lot of options for rendering TOML, I thought it was worth sharing.
PS. It would be great to make this a feature by providing a qtoml.InlineTableDict class (which simply subclasses UserDict).
The text was updated successfully, but these errors were encountered:
pastelmind
changed the title
Add docs on force-generating inline tables?
Force-generating inline tables
Jan 24, 2020
I've been trying to explicitly generate inline tables for my data. After a bit of hacking, I discovered an interesting solution for v0.3.0:
This yields:
The current implementation of
TOMLEncoder.dump_sections()
always rendersdict
as regular tables even if a dumper is assigned toTOMLEncoder.st
. Sincecollections.UserDict
is not a subclass ofdict
, it circumvents this issue.I know this is fragile and unreliable. However, since qtoml doesn't expose a lot of options for rendering TOML, I thought it was worth sharing.
PS. It would be great to make this a feature by providing a
qtoml.InlineTableDict
class (which simply subclassesUserDict
).The text was updated successfully, but these errors were encountered: