#!/usr/bin/env python3
import tomlkit
doc = tomlkit.loads("a.b = 1\na.c = 2\na.d = 3\n")
doc["a"]["b"] = {"x": 9}
output = tomlkit.dumps(doc)
print(output)
result
[a.b]
x = 9
a.c = 2
a.d = 3
in which a.c and a.d have become children of the [a.b] table
similar to #542, #543, but not fixed by PRs currently open for those so should be distinct.
result
in which
a.canda.dhave become children of the[a.b]tablesimilar to #542, #543, but not fixed by PRs currently open for those so should be distinct.