-
-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
Hello,
Here's a strange one.
From this toml:
a.b.c = "d"
a.b.e = "f"When we access value["a"], it behaves correctly but the repr is missing the "c" key.
import tomlkit
print(tomlkit.__version__)
# 0.13.3
a = tomlkit.parse("""
a.b.c = "d"
a.b.e = "f"
""")
assert a == {"a": {"b": {"c": "d", "e": "f"}}} # ok
value = a["a"]
expected = {"b": {"c": "d", "e": "f"}}
assert value == expected # ok
print(value)
# {'b': {'e': 'f'}}
print(expected)
# {'b': {'c': 'd', 'e': 'f'}}
assert repr(value) == repr(expected)
# Traceback (most recent call last):
# File "/Users/joachim/code/raincoat2/oops.py", line 19, in <module>
# assert repr(value) == repr(expected)
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# AssertionErrorAs far as I can tell, this doesn't happen on a, only on a["a"].
I've tried to simplify the issue as much as possible.
Metadata
Metadata
Assignees
Labels
No labels