Skip to content

scalar wrongly captured by dictionary #543

Description

@dimbleby

Another on the theme of: output keys in the wrong order changing the meaning of the dictionary:

#!/usr/bin/env python3

import tomlkit


doc = tomlkit.loads("a.b = 1\n")
doc["a"]["c"] = {}
doc["z"] = 2

print(tomlkit.dumps(doc))

result

a.b = 1

[a.c]
z = 2

in which z is no longer a top-level key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions