-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
We're loading in YAML files where we allow the dot notation in place of nested keys. Therefore, the keypath_separator is . and I'd like that to remain the separator in the resulting benedict.
Therefore: foo.bar: 1 should be loaded in as {'foo': {'bar': 1}} and then be accessible as my_dict["foo.bar"] and my_dict["foo"]["bar"].
Interestingly, in the currently benedict implementation, I can make this happen for top-level keys containing the keypath separator, as follows:
[In]
my_dict = {"foo.bar": 1}
my_benedict = benedict()
my_benedict.merge(my_dict)
my_benedict
[Out]
{'foo': {'bar': 1}}But I get the (expected) error in these two cases:
benedict({"foo.bar": 1})my_dict = {"baz": {"foo.bar": 1}}
my_benedict = benedict()
my_benedict.merge(my_dict)python-benedict version: 0.33.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Done