Empty values (handling None type)
itepifanio opened this issue · 1 comments
itepifanio commented
Toml files can be written without values example:
user="support@company.com"
password=
This empty values could be translated to/from None
. So I would expect something like:
import tomli_w
doc = {"table": {"nested": {}, "val3": 3}, "val2": 2, "val1": None}
expected_toml = """\
val2 = 2
val1 =
[table]
val3 = 3
[table.nested]
"""
assert tomli_w.dumps(doc) == expected_toml
to work, but it's not the case.
hukkin commented
Thanks for the issue, but TOML does not have null values so this will not be accepted. Tomli-W should not dump invalid TOML.