4 ms·
I agree. That's partly why I wrote this: https://github.com/crdoconnor/strictyaml https://github.com/crdoconnor/strictyaml e.g. >>> load(x, Map({"YAML": M
by crdoconnor 10y ago
I agree. That's partly why I wrote this: https://github.com/crdoconnor/strictyaml https://github.com/crdoconnor/strictyaml
e.g.
>>> load(x, Map({"YAML": MapPattern(Str(), Str())}))
{'YAML': {'spring,summer,fall,winter': '3,6,9,12',
"takes a no for a 'no'": 'no',
'the game is': 'on'}}
>>> load(x, Map({"YAML": Map({"spring,summer,fall,winter": Str(), "takes a no for a 'no'": Bool(), "the game is": Bool()})}))
{'YAML': {'spring,summer,fall,winter': '3,6,9,12',
"takes a no for a 'no'": False,
'the game is': True}}