Closed
Description
I have a YAML file:
criteria:
sensor:
positive:
accuracy: [-0.08, 0.08]
range: [0.15, 0.3]
negative:
accuracy: [-0.08, 0.08]
range: [0.05, 0.3]
power_domain:
off: [0, 3.4]
on: [3, 3.4]
When I run this though yaml.safe_load()
, I get the following:
{'criteria': {'sensor': {'positive': {'accuracy': [-0.08, 0.08], 'range': [0.15, 0.3]}, 'negative': {'accuracy': [-0.08, 0.08], 'range': [0.05, 0.3]}}, 'power_domain': {False: [0, 3.4], True: [3, 3.4]}}}
Notice the 'power_domain': {False: [0, 3.4], True: [3, 3.4]}
in particular.
safe_load()
is renaming the keys from on
to True
and off
to False
.
I do understand why the renaming happens in the case of a value, but it doesn't make much sense in the case of a key
Metadata
Metadata
Assignees
Labels
No labels